From fd45aa628520fcf18d44d90579f99ad614ba2827 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Fri, 2 Jan 2026 20:49:04 +0100 Subject: [PATCH] Fixes --- .github/workflows/tests.yml | 4 ++-- .../Source/devices/CardputerKeyboard.cpp | 4 ++-- Drivers/BQ25896/Source/Bq25896.cpp | 2 +- LICENSE.md | 2 +- .../Include/Tactility/EventGroup.h | 10 +++++----- TactilityFreeRtos/Include/Tactility/Thread.h | 4 ++-- .../Include/Tactility/kernel/Kernel.h | 18 +++++++++--------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f93e5386..9c5d7c06 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: run: cmake --build build --target build-tests - name: "Run TactilityCore Tests" run: build/Tests/TactilityCore/TactilityCoreTests --exit - - name: "Run TactilityFreertos Tests" - run: build/Tests/TactilityFreertos/TactilityFreertosTests --exit + - name: "Run TactilityFreeRtos Tests" + run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests --exit - name: "Run TactilityHeadless Tests" run: build/Tests/Tactility/TactilityTests --exit diff --git a/Devices/m5stack-cardputer-adv/Source/devices/CardputerKeyboard.cpp b/Devices/m5stack-cardputer-adv/Source/devices/CardputerKeyboard.cpp index 82945f62..01a1aa3b 100644 --- a/Devices/m5stack-cardputer-adv/Source/devices/CardputerKeyboard.cpp +++ b/Devices/m5stack-cardputer-adv/Source/devices/CardputerKeyboard.cpp @@ -125,7 +125,7 @@ bool CardputerKeyboard::startLvgl(lv_display_t* display) { keypad->init(7, 8); assert(inputTimer == nullptr); - inputTimer = std::make_unique(tt::Timer::Type::Periodic, [this] { + inputTimer = std::make_unique(tt::Timer::Type::Periodic, pdMS_TO_TICKS(20), [this] { processKeyboard(); }); @@ -135,7 +135,7 @@ bool CardputerKeyboard::startLvgl(lv_display_t* display) { lv_indev_set_display(kbHandle, display); lv_indev_set_user_data(kbHandle, this); - inputTimer->start(20 / portTICK_PERIOD_MS); + inputTimer->start(); return true; } diff --git a/Drivers/BQ25896/Source/Bq25896.cpp b/Drivers/BQ25896/Source/Bq25896.cpp index 020027d7..0b305495 100644 --- a/Drivers/BQ25896/Source/Bq25896.cpp +++ b/Drivers/BQ25896/Source/Bq25896.cpp @@ -2,7 +2,7 @@ #include -constexpr auto* TAG = "BQ27220"; +constexpr auto* TAG = "BQ25896"; void Bq25896::powerOff() { TT_LOG_I(TAG, "Power off"); diff --git a/LICENSE.md b/LICENSE.md index 9c697f9c..a3d02695 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -13,7 +13,7 @@ Third party projects that were included in Tactility retain their licenses. The following projects are also available under [Apache License Version 2.0](Documentation/license-tactilitysdk.md): - TactilityC -- TactilityFreertos +- TactilityFreeRtos - TactilitySDK (source and binaries) # Other licenses & copyrights diff --git a/TactilityFreeRtos/Include/Tactility/EventGroup.h b/TactilityFreeRtos/Include/Tactility/EventGroup.h index 92146300..2d80fe72 100644 --- a/TactilityFreeRtos/Include/Tactility/EventGroup.h +++ b/TactilityFreeRtos/Include/Tactility/EventGroup.h @@ -87,12 +87,12 @@ public: *outError = Error::Resource; } return false; - } else { - if (outFlags != nullptr) { - *outFlags = result; - } - return true; } + if (outFlags != nullptr) { + *outFlags = result; + } + portYIELD_FROM_ISR(pdTRUE); + return true; } else { auto result = xEventGroupClearBits(handle.get(), flags); if (outFlags != nullptr) { diff --git a/TactilityFreeRtos/Include/Tactility/Thread.h b/TactilityFreeRtos/Include/Tactility/Thread.h index 686bc587..d32d1bc3 100644 --- a/TactilityFreeRtos/Include/Tactility/Thread.h +++ b/TactilityFreeRtos/Include/Tactility/Thread.h @@ -47,7 +47,7 @@ private: static constexpr auto TAG = "Thread"; - static_assert(static_cast(Priority::Critical) <= configMAX_PRIORITIES, "Highest thread priority is higher than max priority"); + static_assert(static_cast(Priority::Critical) < configMAX_PRIORITIES, "Highest thread priority is higher than max priority"); static void mainBody(void* context) { assert(context != nullptr); @@ -112,7 +112,7 @@ public: affinity(affinity) {} - /** @warning If thread is running, you mjust call join() first */ + /** @warning If thread is running, you just call join() first */ ~Thread() { assert(state == State::Stopped); assert(taskHandle == nullptr); diff --git a/TactilityFreeRtos/Include/Tactility/kernel/Kernel.h b/TactilityFreeRtos/Include/Tactility/kernel/Kernel.h index bdb95dad..684d5a16 100644 --- a/TactilityFreeRtos/Include/Tactility/kernel/Kernel.h +++ b/TactilityFreeRtos/Include/Tactility/kernel/Kernel.h @@ -24,7 +24,7 @@ constexpr uint32_t getTickFrequency() { } /** @return the amount of ticks that has passed in the main kernel task */ -constexpr TickType_t getTicks() { +inline TickType_t getTicks() { if (xPortInIsrContext() == pdTRUE) { return xTaskGetTickCountFromISR(); } else { @@ -34,12 +34,12 @@ constexpr TickType_t getTicks() { /** @return the amount of milliseconds that has passed in the main kernel tasks */ -constexpr size_t getMillis() { +inline size_t getMillis() { return getTicks() * portTICK_PERIOD_MS; } /** @return the microseconds that have passed since boot */ -constexpr int64_t getMicrosSinceBoot() { +inline int64_t getMicrosSinceBoot() { #ifdef ESP_PLATFORM return esp_timer_get_time(); #else @@ -50,12 +50,12 @@ constexpr int64_t getMicrosSinceBoot() { } /** Convert seconds to ticks */ -constexpr TickType_t secondsToTicks(uint32_t seconds) { - return static_cast(seconds) * 1000U / portTICK_PERIOD_MS; +inline TickType_t secondsToTicks(uint32_t seconds) { + return static_cast(seconds) * 1000U / portTICK_PERIOD_MS; } /** Convert milliseconds to ticks */ -constexpr TickType_t millisToTicks(uint32_t milliSeconds) { +inline TickType_t millisToTicks(uint32_t milliSeconds) { #if configTICK_RATE_HZ == 1000 return static_cast(milliSeconds); #else @@ -67,7 +67,7 @@ constexpr TickType_t millisToTicks(uint32_t milliSeconds) { * Delay the current task for the specified amount of ticks * @warning Does not work in ISR context */ -constexpr void delayTicks(TickType_t ticks) { +inline void delayTicks(TickType_t ticks) { assert(xPortInIsrContext() == pdFALSE); if (ticks == 0U) { taskYIELD(); @@ -80,7 +80,7 @@ constexpr void delayTicks(TickType_t ticks) { * Delay the current task for the specified amount of milliseconds * @warning Does not work in ISR context */ -constexpr void delayMillis(uint32_t milliSeconds) { +inline void delayMillis(uint32_t milliSeconds) { delayTicks(millisToTicks(milliSeconds)); } @@ -88,7 +88,7 @@ constexpr void delayMillis(uint32_t milliSeconds) { * Stall the currently active CPU core for the specified amount of microseconds. * This does not allow other tasks to run on the stalled CPU core. */ -constexpr void delayMicros(uint32_t microseconds) { +inline void delayMicros(uint32_t microseconds) { #ifdef ESP_PLATFORM ets_delay_us(microseconds); #else