Create TactilityFreertos subproject (#440)

This commit is contained in:
Ken Van Hoeylandt
2026-01-03 00:19:40 +01:00
committed by GitHub
parent a4dc633063
commit 7283920def
154 changed files with 1926 additions and 2676 deletions
+7 -4
View File
@@ -1,6 +1,9 @@
#include "Tactility/kernel/SystemEvents.h"
#include <Tactility/kernel/SystemEvents.h>
#include <Tactility/Check.h>
#include <Tactility/Log.h>
#include <Tactility/Mutex.h>
#include <list>
namespace tt::kernel {
@@ -56,7 +59,7 @@ static const char* getEventName(SystemEvent event) {
void publishSystemEvent(SystemEvent event) {
TT_LOG_I(TAG, "%s", getEventName(event));
if (mutex.lock(portMAX_DELAY)) {
if (mutex.lock(kernel::MAX_TICKS)) {
for (auto& subscription : subscriptions) {
if (subscription.event == event) {
subscription.handler(event);
@@ -68,7 +71,7 @@ void publishSystemEvent(SystemEvent event) {
}
SystemEventSubscription subscribeSystemEvent(SystemEvent event, OnSystemEvent handler) {
if (mutex.lock(portMAX_DELAY)) {
if (mutex.lock(kernel::MAX_TICKS)) {
auto id = ++subscriptionCounter;
subscriptions.push_back({
@@ -85,7 +88,7 @@ SystemEventSubscription subscribeSystemEvent(SystemEvent event, OnSystemEvent ha
}
void unsubscribeSystemEvent(SystemEventSubscription subscription) {
if (mutex.lock(portMAX_DELAY)) {
if (mutex.lock(kernel::MAX_TICKS)) {
std::erase_if(subscriptions, [subscription](auto& item) {
return (item.id == subscription);
});