Ken Van Hoeylandt 27730260e0
Project restructuring: add tactility-headless (#55)
- Created `tactility-headless` to support ESP32 firmwares that don't require graphics
- `tactility` subproject now contains both PC and ESP32 code (to avoid having to split up `tactility` and `tactility-headless` into separate projects, which would result in a very complex dependency tree)
- `tactility` subproject is now defined as component for ESP32 and as regular module for PC
- Improvements for dispatcher
- Added `project-structure.puml` to docs
- `Gui` service now depends on `Loader` service instead of the reverse
- Added `statusbar_updater` service for updating Wi-Fi and SD card icons
2024-08-31 17:56:28 +02:00

55 lines
1.2 KiB
C

#pragma once
#ifdef ESP_TARGET
#include "esp_log.h"
#else
#include <stdarg.h>
#include <stdio.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef ESP_TARGET
#define TT_LOG_E(tag, format, ...) \
ESP_LOGE(tag, format, ##__VA_ARGS__)
#define TT_LOG_W(tag, format, ...) \
ESP_LOGW(tag, format, ##__VA_ARGS__)
#define TT_LOG_I(tag, format, ...) \
ESP_LOGI(tag, format, ##__VA_ARGS__)
#define TT_LOG_D(tag, format, ...) \
ESP_LOGD(tag, format, ##__VA_ARGS__)
#define TT_LOG_T(tag, format, ...) \
ESP_LOGV(tag, format, ##__VA_ARGS__)
#else
typedef enum {
LogLevelError,
LogLevelWarning,
LogLevelInfo,
LogLevelDebug,
LogLevelTrace
} LogLevel;
void tt_log(LogLevel level, const char* tag, const char* format, ...);
#define TT_LOG_E(tag, format, ...) \
tt_log(LogLevelError, tag, format, ##__VA_ARGS__)
#define TT_LOG_W(tag, format, ...) \
tt_log(LogLevelWarning, tag, format, ##__VA_ARGS__)
#define TT_LOG_I(tag, format, ...) \
tt_log(LogLevelInfo, tag, format, ##__VA_ARGS__)
#define TT_LOG_D(tag, format, ...) \
tt_log(LogLevelDebug, tag, format, ##__VA_ARGS__)
#define TT_LOG_T(tag, format, ...) \
tt_log(LOG_LEVEL_TRACE, tag, format, ##__VA_ARGS__)
#endif // ESP_TARGET
#ifdef __cplusplus
}
#endif