From 63866fb371edc5723abdb14a165198dcfd9cf44b Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Sat, 6 Sep 2025 18:43:11 +0200 Subject: [PATCH] Merge develop into main (#322) - Fix crash in TactilityC - Improve MAX_TICKS implementation (and renamed to TT_MAX_TICKS) --- .../GraphicsDemo/main/Include/drivers/DisplayDriver.h | 2 +- TactilityC/Include/tt_kernel.h | 2 +- TactilityC/Source/tt_app.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ExternalApps/GraphicsDemo/main/Include/drivers/DisplayDriver.h b/ExternalApps/GraphicsDemo/main/Include/drivers/DisplayDriver.h index d699093f..1b4310cf 100644 --- a/ExternalApps/GraphicsDemo/main/Include/drivers/DisplayDriver.h +++ b/ExternalApps/GraphicsDemo/main/Include/drivers/DisplayDriver.h @@ -22,7 +22,7 @@ public: tt_hal_display_driver_free(handle); } - bool lock(TickType timeout = MAX_TICKS) const { + bool lock(TickType timeout = TT_MAX_TICKS) const { return tt_hal_display_driver_lock(handle, timeout); } diff --git a/TactilityC/Include/tt_kernel.h b/TactilityC/Include/tt_kernel.h index 0777c706..c968e32b 100644 --- a/TactilityC/Include/tt_kernel.h +++ b/TactilityC/Include/tt_kernel.h @@ -8,7 +8,7 @@ extern "C" { typedef unsigned long TickType; -#define MAX_TICKS INT32_MAX +#define TT_MAX_TICKS ((TickType)(~(TickType)0)) /** * Stall the current task for the specified amount of time. diff --git a/TactilityC/Source/tt_app.cpp b/TactilityC/Source/tt_app.cpp index e1b4a204..26bed03a 100644 --- a/TactilityC/Source/tt_app.cpp +++ b/TactilityC/Source/tt_app.cpp @@ -41,7 +41,7 @@ void tt_app_get_data_directory(AppPathsHandle handle, char* buffer, size_t* size auto data_path = paths->getDataDirectory(); auto expected_length = data_path.length() + 1; if (*size < expected_length) { - TT_LOG_E(TAG, "Path buffer not large enough (%d < %d)", size, expected_length); + TT_LOG_E(TAG, "Path buffer not large enough (%d < %d)", *size, expected_length); *size = 0; buffer[0] = 0; return; @@ -59,7 +59,7 @@ void tt_app_get_data_directory_lvgl(AppPathsHandle handle, char* buffer, size_t* auto data_path = paths->getDataDirectoryLvgl(); auto expected_length = data_path.length() + 1; if (*size < expected_length) { - TT_LOG_E(TAG, "Path buffer not large enough (%d < %d)", size, expected_length); + TT_LOG_E(TAG, "Path buffer not large enough (%d < %d)", *size, expected_length); *size = 0; buffer[0] = 0; return;