New logging and more (#446)
- `TT_LOG_*` macros are replaced by `Logger` via `#include<Tactility/Logger.h>` - Changed default timezone to Europe/Amsterdam - Fix for logic bug in unPhone hardware - Fix for init/deinit in DRV2605 driver - Other fixes - Removed optimization that broke unPhone (disabled the moving of heap-related functions to flash)
This commit is contained in:
committed by
GitHub
parent
719f7bcece
commit
f620255c41
@@ -14,7 +14,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreDefines.h"
|
||||
#include "Log.h"
|
||||
#include "Logger.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@@ -28,17 +28,18 @@ namespace tt {
|
||||
TT_NORETURN void _crash();
|
||||
}
|
||||
|
||||
// TODO: Move crash logic to kernel namespace and consider refactoring to C++
|
||||
/** Crash system with message. */
|
||||
#define tt_crash(...) TT_ARG_CAT(_tt_crash,TT_ARGCOUNT(__VA_ARGS__))(__VA_ARGS__)
|
||||
|
||||
#define _tt_crash0() do { \
|
||||
TT_LOG_E("crash", "at %s:%d", __FILE__, __LINE__); \
|
||||
tt::Logger("Kernel").error("Crash at {}:{}", __FILE__, __LINE__); \
|
||||
tt::_crash(); \
|
||||
} while (0)
|
||||
|
||||
#define _tt_crash1(message) do { \
|
||||
TT_LOG_E("crash", "%s\n\tat %s:%d", message, __FILE__, __LINE__); \
|
||||
tt::_crash(); \
|
||||
#define _tt_crash1(message) do { \
|
||||
tt::Logger("Kernel").error("Crash: {}\n\tat {}:{}", message, __FILE__, __LINE__); \
|
||||
tt::_crash(); \
|
||||
} while (0)
|
||||
|
||||
/** Halt the system
|
||||
@@ -50,11 +51,11 @@ namespace tt {
|
||||
#define tt_check_internal(__e, __m) \
|
||||
do { \
|
||||
if (!(__e)) { \
|
||||
TT_LOG_E("check", "%s", #__e); \
|
||||
tt::Logger("Kernel").error("Check failed: {}", #__e); \
|
||||
if (__m) { \
|
||||
tt_crash_internal(#__m); \
|
||||
tt_crash(__m); \
|
||||
} else { \
|
||||
tt_crash_internal(""); \
|
||||
tt_crash(""); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
@@ -65,4 +66,4 @@ namespace tt {
|
||||
* @param[in] optional message (const char*)
|
||||
*/
|
||||
|
||||
#define tt_check(x, ...) if (!(x)) { TT_LOG_E("check", "Failed: %s", #x); tt::_crash(); }
|
||||
#define tt_check(x, ...) if (!(x)) { tt::Logger("Kernel").error("Check failed: {}", #x); tt::_crash(); }
|
||||
|
||||
Reference in New Issue
Block a user