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:
Ken Van Hoeylandt
2026-01-06 22:35:39 +01:00
committed by GitHub
parent 719f7bcece
commit f620255c41
188 changed files with 1973 additions and 1755 deletions
@@ -2,7 +2,7 @@
#if TT_FEATURE_SCREENSHOT_ENABLED
#include <Tactility/Log.h>
#include <Tactility/Logger.h>
#include <Tactility/LogMessages.h>
#include <Tactility/service/screenshot/Screenshot.h>
#include <Tactility/service/ServiceRegistration.h>
@@ -12,7 +12,7 @@
namespace tt::service::screenshot {
constexpr auto* TAG = "ScreenshotService";
static const auto LOGGER = Logger("ScreenshotService");
extern const ServiceManifest manifest;
@@ -23,7 +23,7 @@ std::shared_ptr<ScreenshotService> _Nullable optScreenshotService() {
void ScreenshotService::startApps(const std::string& path) {
auto lock = mutex.asScopedLock();
if (!lock.lock(50 / portTICK_PERIOD_MS)) {
TT_LOG_W(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED);
LOGGER.warn(LOG_MESSAGE_MUTEX_LOCK_FAILED);
return;
}
@@ -32,14 +32,14 @@ void ScreenshotService::startApps(const std::string& path) {
mode = Mode::Apps;
task->startApps(path);
} else {
TT_LOG_W(TAG, "Screenshot task already running");
LOGGER.warn("Screenshot task already running");
}
}
void ScreenshotService::startTimed(const std::string& path, uint8_t delayInSeconds, uint8_t amount) {
auto lock = mutex.asScopedLock();
if (!lock.lock(50 / portTICK_PERIOD_MS)) {
TT_LOG_W(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED);
LOGGER.warn(LOG_MESSAGE_MUTEX_LOCK_FAILED);
return;
}
@@ -48,13 +48,13 @@ void ScreenshotService::startTimed(const std::string& path, uint8_t delayInSecon
mode = Mode::Timed;
task->startTimed(path, delayInSeconds, amount);
} else {
TT_LOG_W(TAG, "Screenshot task already running");
LOGGER.warn("Screenshot task already running");
}
}
bool ScreenshotService::onStart(ServiceContext& serviceContext) {
if (lv_screen_active() == nullptr) {
TT_LOG_E(TAG, "No display found");
LOGGER.error("No display found");
return false;
}
@@ -64,7 +64,7 @@ bool ScreenshotService::onStart(ServiceContext& serviceContext) {
void ScreenshotService::stop() {
auto lock = mutex.asScopedLock();
if (!lock.lock(50 / portTICK_PERIOD_MS)) {
TT_LOG_W(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED);
LOGGER.warn(LOG_MESSAGE_MUTEX_LOCK_FAILED);
return;
}
@@ -72,14 +72,14 @@ void ScreenshotService::stop() {
task = nullptr;
mode = Mode::None;
} else {
TT_LOG_W(TAG, "Screenshot task not running");
LOGGER.warn("Screenshot task not running");
}
}
Mode ScreenshotService::getMode() const {
auto lock = mutex.asScopedLock();
if (!lock.lock(50 / portTICK_PERIOD_MS)) {
TT_LOG_W(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED);
LOGGER.warn(LOG_MESSAGE_MUTEX_LOCK_FAILED);
return Mode::None;
}