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
+5 -4
View File
@@ -5,6 +5,7 @@
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/lvgl/Spinner.h>
#include <Tactility/lvgl/Toolbar.h>
#include <Tactility/Logger.h>
#include <Tactility/network/Http.h>
#include <Tactility/Paths.h>
#include <Tactility/service/loader/Loader.h>
@@ -16,7 +17,7 @@
namespace tt::app::apphub {
constexpr auto* TAG = "AppHub";
static const auto LOGGER = Logger("AppHub");
extern const AppManifest manifest;
@@ -55,7 +56,7 @@ class AppHubApp final : public App {
}
void onRefreshSuccess() {
TT_LOG_I(TAG, "Request success");
LOGGER.info("Request success");
auto lock = lvgl::getSyncLock()->asScopedLock();
lock.lock();
@@ -63,7 +64,7 @@ class AppHubApp final : public App {
}
void onRefreshError(const char* error) {
TT_LOG_E(TAG, "Request failed: %s", error);
LOGGER.error("Request failed: {}", error);
auto lock = lvgl::getSyncLock()->asScopedLock();
lock.lock();
@@ -106,7 +107,7 @@ class AppHubApp final : public App {
lv_obj_set_size(list, LV_PCT(100), LV_SIZE_CONTENT);
for (int i = 0; i < entries.size(); i++) {
auto& entry = entries[i];
TT_LOG_I(TAG, "Adding %s", entry.appName.c_str());
LOGGER.info("Adding {}", entry.appName.c_str());
const char* icon = findAppManifestById(entry.appId) != nullptr ? LV_SYMBOL_OK : nullptr;
auto* entry_button = lv_list_add_button(list, icon, entry.appName.c_str());
auto int_as_voidptr = reinterpret_cast<void*>(i);
+6 -5
View File
@@ -1,10 +1,11 @@
#include <Tactility/app/apphub/AppHubEntry.h>
#include <Tactility/file/File.h>
#include <Tactility/json/Reader.h>
#include <Tactility/Logger.h>
namespace tt::app::apphub {
constexpr auto* TAG = "AppHubJson";
static const auto LOGGER = Logger("AppHubJson");
static bool parseEntry(const cJSON* object, AppHubEntry& entry) {
const json::Reader reader(object);
@@ -24,21 +25,21 @@ bool parseJson(const std::string& filePath, std::vector<AppHubEntry>& entries) {
auto data = file::readString(filePath);
if (data == nullptr) {
TT_LOG_E(TAG, "Failed to read %s", filePath.c_str());
LOGGER.error("Failed to read {}", filePath);
return false;
}
auto data_ptr = reinterpret_cast<const char*>(data.get());
auto* json = cJSON_Parse(data_ptr);
if (json == nullptr) {
TT_LOG_E(TAG, "Failed to parse %s", filePath.c_str());
LOGGER.error("Failed to parse {}", filePath);
return false;
}
const cJSON* apps_json = cJSON_GetObjectItemCaseSensitive(json, "apps");
if (!cJSON_IsArray(apps_json)) {
cJSON_Delete(json);
TT_LOG_E(TAG, "apps is not an array");
LOGGER.error("apps is not an array");
return false;
}
@@ -48,7 +49,7 @@ bool parseJson(const std::string& filePath, std::vector<AppHubEntry>& entries) {
auto& entry = entries.at(i);
auto* entry_json = cJSON_GetArrayItem(apps_json, i);
if (!parseEntry(entry_json, entry)) {
TT_LOG_E(TAG, "Failed to read entry");
LOGGER.error("Failed to read entry");
cJSON_Delete(json);
return false;
}