From 098ef140a6393efc1af877cdfdead4de8162a75b Mon Sep 17 00:00:00 2001 From: dario Date: Tue, 7 Nov 2023 12:37:53 +0100 Subject: [PATCH 1/7] Added changes for potential statemachine rework --- .settings/language.settings.xml | 4 +- App/Src/startup.cpp | 32 --------- Libs/sta-core | 2 +- Tacos/include/sta/tacos/statemachine.hpp | 73 ++++++++++--------- Tacos/src/statemachine.cpp | 89 +++++++++++------------- 5 files changed, 82 insertions(+), 118 deletions(-) diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index f807aa8..13cbd4a 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/App/Src/startup.cpp b/App/Src/startup.cpp index 884a1f3..9b5186a 100644 --- a/App/Src/startup.cpp +++ b/App/Src/startup.cpp @@ -24,38 +24,6 @@ namespace sta { void onStatemachineInit() { - Statemachine::instance()->setStateFunction([](uint16_t state) -> uint16_t { - // ###### Implement your state transition function here! ###### - - /** - * This function should return some state within 0 and STA_TACOS_NUM_STATES (specified in the config.hpp). - * Return the same state as given as the argument for no state transition. Make sure, that this function is not - * computationally expensive. - */ - - return state; - }); - - Statemachine::instance()->setTimerFunction([](uint16_t state, uint16_t lastState, uint32_t event) { - // ###### Set the failsafe and lockout timers here ###### - - /** - * This function is called after a state transition from lastState to state. Event corresponds to EventFlag enum in the Statemachine - * and encode how the state change happened. - * - * Setting a timer here is fully optional and depends on your system's specifications. - */ - - uint32_t someFailsafeMillis = 42; - uint16_t someNextState = STA_TACOS_INITIAL_STATE; - uint32_t someLockoutMillis = 21; - - // Start the failsafe timer to force a state transition to someNextState after someFailsafeMillis milliseconds. - Statemachine::instance()->setFailsafeTimer(someFailsafeMillis, someNextState); - - // Start the lockout timer to block a state transition for the first someLockoutMillis milliseconds. - Statemachine::instance()->setLockoutTimer(someLockoutMillis); - }); } diff --git a/Libs/sta-core b/Libs/sta-core index 4da1f0b..71170d4 160000 --- a/Libs/sta-core +++ b/Libs/sta-core @@ -1 +1 @@ -Subproject commit 4da1f0bb7dd48f89e9dd5ee0ec181638894e55e2 +Subproject commit 71170d4cea428fffb05fc2666201d390ff411fc4 diff --git a/Tacos/include/sta/tacos/statemachine.hpp b/Tacos/include/sta/tacos/statemachine.hpp index bf5fa4c..99b444a 100644 --- a/Tacos/include/sta/tacos/statemachine.hpp +++ b/Tacos/include/sta/tacos/statemachine.hpp @@ -20,6 +20,8 @@ # define STA_TACOS_INITIAL_STATE 0 #endif +#define STA_TACOS_STATEMACHINE_QUEUE_LENGTH 4 + // State transition happened because of #define STA_TACOS_STATE_CHANGE_NORMAL_FLAG ( 0x1U ) #define STA_TACOS_STATE_CHANGE_FORCED_FLAG ( 0x1U << 1) @@ -29,34 +31,41 @@ #include +#include #include #include #include #include #include +#include namespace sta { namespace tacos { - typedef std::function state_fn; - typedef std::function timer_fn; + enum EventFlags + { + NORMAL = 0x1U, + FORCED = 0x1U << 1, + TIMEOUT = 0x1U << 2, + STARTUP = 0x1U << 3, + ALL = NORMAL | FORCED | TIMEOUT | STARTUP + }; + + struct StateTransition + { + uint16_t from; + uint16_t to; + EventFlags event; + uint32_t lockout; + }; class Statemachine : public TacosThread { public: - enum EventFlags - { - NORMAL = 0x1U, - FORCED = 0x1U << 1, - TIMEOUT = 0x1U << 2, - STARTUP = 0x1U << 3, - ALL = NORMAL | FORCED | TIMEOUT | STARTUP - }; - /** * @brief The global event signaling a state change. */ @@ -84,29 +93,23 @@ namespace sta uint16_t getCurrentState() const; /** - * @brief Registers a new state transition function. This is a function for the user to implement state transition rules. + * @brief Request a state transition from a state to another. + * + * @param from The state which we want to leave. This is used to filter out obsolete transitions. + * @param to The state to transition to. + * @param lockout The minimum number of milliseconds we expect to stay in this state. This is used to block premature transitions. */ - void setStateFunction(state_fn func); + void requestStateTransition(uint32_t from, uint32_t to, uint32_t lockout = 0); /** - * @brief Registers a new timer function. This is a function for the user to set the timers after a state change. + * @brief Request a state transition after a given time has passed. + * + * @param from The state which we want to leave. This is used to filter out obsolete transitions. + * @param to The state to transition to. + * @param millis the number of milliseconds to wait before triggering the transition. + * @param lockout The minimum number of milliseconds we expect to stay in this state. This is used to block premature transitions. */ - void setTimerFunction(timer_fn func); - - /** - * @brief Starts the failsafe timer for the desired duration and the desired next state. - */ - void setFailsafeTimer(uint32_t millis, uint16_t nextState); - - /** - * @brief Starts the lockoutTimer for the desired duration. - */ - void setLockoutTimer(uint32_t millis); - - /** - * @brief this function call allows forced state transitions from external and internal sources. - */ - void forceStateTransition(uint16_t state); + void requestTimedStateTransition(uint32_t from, uint32_t to, uint32_t millis, uint32_t lockout = 0); void init() override; void func() override; @@ -133,15 +136,19 @@ namespace sta ~Statemachine() {} + private: + /** + * @brief Starts the lockoutTimer for the desired duration. + */ + void setLockoutTimer(uint32_t millis); + private: uint16_t currentState_; - uint16_t failsafeState_; RtosTimer lockoutTimer_; RtosTimer failsafeTimer_; - state_fn transitionFunc_; - timer_fn timerFunc_; + RtosQueue queue_; }; } // namespace tacos } // namespace sta diff --git a/Tacos/src/statemachine.cpp b/Tacos/src/statemachine.cpp index c7daf0f..aade590 100644 --- a/Tacos/src/statemachine.cpp +++ b/Tacos/src/statemachine.cpp @@ -21,7 +21,8 @@ namespace sta lockoutTimer_{[](void *){}, nullptr}, failsafeTimer_{[](void *){}, nullptr}, transitionFunc_{[](uint16_t) -> uint16_t { return Statemachine::instance()->getCurrentState(); }}, - timerFunc_{[](uint16_t, uint16_t, uint16_t) {}} + timerFunc_{[](uint16_t, uint16_t, uint16_t) {}}, + queue_{STA_TACOS_STATEMACHINE_QUEUE_LENGTH} { STA_ASSERT(STA_TACOS_INITIAL_STATE < STA_TACOS_NUM_STATES); } @@ -33,31 +34,40 @@ namespace sta void Statemachine::func() { - if (!lockoutTimer_.isRunning()) + // Wait for a message to be added to the queue. + StateTransition transition; + queue_.get(&transition, osWaitForever); + + // Check if the transition isn't blocked and is legal. + if (!lockoutTimer_.isRunning() && transition.from == currentState_) { - uint16_t next = transitionFunc_(currentState_); + STA_ASSERT(transition.to < STA_TACOS_NUM_STATES); - STA_ASSERT(next < STA_TACOS_NUM_STATES); + // Perform the transition and notify the threads. The event flags are set + // here in order to allow threads to react immediately. + currentState_ = transition.to; + Statemachine::stateChangeEvent.set(transition.event); + Statemachine::stateChangeEvent.clear(EventFlags::ALL); - // Check if a state change is desired. Block if the lockoutTimer is still running. - if (next != currentState_) + if (failsafeTimer_.isRunning()) { - if (failsafeTimer_.isRunning()) - { - failsafeTimer_.stop(); - } + failsafeTimer_.stop(); + } - // Call user space code to set the timers again. - timerFunc_(next, currentState_, EventFlags::NORMAL); + // Start the lockout timer if requested. + if (transition.lockout != NULL) + { + setLockoutTimer(transition.lockout); + } - // Update the state and trigger the global state changed event. - currentState_ = next; - Statemachine::stateChangeEvent.set(EventFlags::NORMAL); - Statemachine::stateChangeEvent.clear(EventFlags::ALL); + // Start the failsafe timer if requested. + if (transition.failsafe != NULL) + { + std::tie(millis, state) = transition.failsafe; + + setFailsafeTimer(millis, state); } } - - osThreadYield(); } uint16_t Statemachine::getCurrentState() const @@ -65,27 +75,25 @@ namespace sta return currentState_; } - void Statemachine::setStateFunction(state_fn func) + void Statemachine::requestStateTransition(uint32_t from, uint32_t to, uint32_t lockout /* = 0 */) { - STA_ASSERT(func != nullptr); + StateTransition transition; + transition.from = from; + transition.to = to; + transition.event = EventFlags::NORMAL; + transition.lockout = lockout; - transitionFunc_ = func; + // TODO: For how should we wait here? + queue_.put(transition); } - void Statemachine::setTimerFunction(timer_fn func) - { - STA_ASSERT(func != nullptr); - - timerFunc_ = func; - } - - void Statemachine::setFailsafeTimer(uint32_t millis, uint16_t nextState) + void Statemachine::requestTimedStateTransition(uint32_t from, uint32_t to, uint32_t millis, uint32_t lockout /* = 0 */) { STA_ASSERT(nextState < STA_TACOS_NUM_STATES); STA_ASSERT(!failsafeTimer_.isRunning()); - failsafeTimer_.setCallback([nextState](void* arg) { - Statemachine::instance()->forceStateTransition(nextState); + failsafeTimer_.setCallback([from, to, lockout](void* arg) { + Statemachine::requestStateTransition(from, to, lockout); }, &failsafeState_); failsafeTimer_.start(millis); @@ -99,25 +107,6 @@ namespace sta lockoutTimer_.start(millis); } - void Statemachine::forceStateTransition(uint16_t state) - { - if (failsafeTimer_.isRunning()) - { - failsafeTimer_.stop(); - } - - if (lockoutTimer_.isRunning()) - { - lockoutTimer_.stop(); - } - - timerFunc_(state, currentState_, EventFlags::FORCED); - currentState_ = state; - - Statemachine::stateChangeEvent.set(EventFlags::FORCED); - Statemachine::stateChangeEvent.clear(EventFlags::ALL); - } - Statemachine* Statemachine::_instance = nullptr; RtosEvent Statemachine::stateChangeEvent; From 59b1005590462a5e359a7fe609fe9fef7e3adce1 Mon Sep 17 00:00:00 2001 From: dario Date: Wed, 8 Nov 2023 19:12:09 +0100 Subject: [PATCH 2/7] Cleaned up compiler errors that I missed somehow. --- Libs/rtos2-utils | 2 +- Tacos/src/manager.cpp | 2 +- Tacos/src/statemachine.cpp | 21 +++++---------------- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Libs/rtos2-utils b/Libs/rtos2-utils index 0e96b2e..c609dc8 160000 --- a/Libs/rtos2-utils +++ b/Libs/rtos2-utils @@ -1 +1 @@ -Subproject commit 0e96b2ec29fde1e56e12fc9f0dceb80012e0caf3 +Subproject commit c609dc81cc70327948aa8173c9d6ad804ae7a642 diff --git a/Tacos/src/manager.cpp b/Tacos/src/manager.cpp index 2b511ef..468c5fb 100644 --- a/Tacos/src/manager.cpp +++ b/Tacos/src/manager.cpp @@ -80,7 +80,7 @@ namespace sta void Manager::func() { - Statemachine::stateChangeEvent.wait(Statemachine::EventFlags::ALL, osWaitForever); + Statemachine::stateChangeEvent.wait(EventFlags::ALL, osWaitForever); HeapStats_t stats; vPortGetHeapStats(&stats); diff --git a/Tacos/src/statemachine.cpp b/Tacos/src/statemachine.cpp index aade590..a3b0227 100644 --- a/Tacos/src/statemachine.cpp +++ b/Tacos/src/statemachine.cpp @@ -17,11 +17,8 @@ namespace sta Statemachine::Statemachine() : TacosThread{"Statemachine", STA_TACOS_STATEMACHINE_PRIORITY}, currentState_{STA_TACOS_INITIAL_STATE}, - failsafeState_{STA_TACOS_INITIAL_STATE}, lockoutTimer_{[](void *){}, nullptr}, failsafeTimer_{[](void *){}, nullptr}, - transitionFunc_{[](uint16_t) -> uint16_t { return Statemachine::instance()->getCurrentState(); }}, - timerFunc_{[](uint16_t, uint16_t, uint16_t) {}}, queue_{STA_TACOS_STATEMACHINE_QUEUE_LENGTH} { STA_ASSERT(STA_TACOS_INITIAL_STATE < STA_TACOS_NUM_STATES); @@ -29,7 +26,7 @@ namespace sta void Statemachine::init() { - timerFunc_(0, 0, EventFlags::STARTUP); + } void Statemachine::func() @@ -55,18 +52,10 @@ namespace sta } // Start the lockout timer if requested. - if (transition.lockout != NULL) + if (transition.lockout != 0) { setLockoutTimer(transition.lockout); } - - // Start the failsafe timer if requested. - if (transition.failsafe != NULL) - { - std::tie(millis, state) = transition.failsafe; - - setFailsafeTimer(millis, state); - } } } @@ -89,12 +78,12 @@ namespace sta void Statemachine::requestTimedStateTransition(uint32_t from, uint32_t to, uint32_t millis, uint32_t lockout /* = 0 */) { - STA_ASSERT(nextState < STA_TACOS_NUM_STATES); + STA_ASSERT(to < STA_TACOS_NUM_STATES); STA_ASSERT(!failsafeTimer_.isRunning()); failsafeTimer_.setCallback([from, to, lockout](void* arg) { - Statemachine::requestStateTransition(from, to, lockout); - }, &failsafeState_); + Statemachine::instance()->requestStateTransition(from, to, lockout); + }, NULL); failsafeTimer_.start(millis); } From 5217945c034d5e6dab0a0ab8cf8adbd2090a87d5 Mon Sep 17 00:00:00 2001 From: dario Date: Fri, 10 Nov 2023 09:53:22 +0100 Subject: [PATCH 3/7] Added first successful test for statemachine rework --- App/Inc/sta/config.hpp | 2 +- App/Inc/tasks/toggle.hpp | 26 ++++++++++++++++++++++++++ App/Src/startup.cpp | 5 ++++- App/Src/tasks/toggle.cpp | 37 +++++++++++++++++++++++++++++++++++++ Libs/rtos2-utils | 2 +- 5 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 App/Inc/tasks/toggle.hpp create mode 100644 App/Src/tasks/toggle.cpp diff --git a/App/Inc/sta/config.hpp b/App/Inc/sta/config.hpp index eee17cb..ac9da2c 100644 --- a/App/Inc/sta/config.hpp +++ b/App/Inc/sta/config.hpp @@ -33,7 +33,7 @@ #define STA_TACOS_STATEMACHINE_PRIORITY osPriorityNormal // Statemachine settings. Here, we only have a single state which is also the initial state. -#define STA_TACOS_NUM_STATES 1 +#define STA_TACOS_NUM_STATES 2 #define STA_TACOS_INITIAL_STATE 0 #endif /* INC_STA_CONFIG_HPP_ */ diff --git a/App/Inc/tasks/toggle.hpp b/App/Inc/tasks/toggle.hpp new file mode 100644 index 0000000..3d14e2f --- /dev/null +++ b/App/Inc/tasks/toggle.hpp @@ -0,0 +1,26 @@ +/* + * toggle.hpp + * + * Created on: Nov 10, 2023 + * Author: Dario + */ + +#ifndef INC_STA_TOGGLE_HPP_ +#define INC_STA_TOGGLE_HPP_ + +#include + +namespace demo +{ + class Toggle : public sta::tacos::TacosThread + { + public: + Toggle(); + + void init() override; + + void func() override; + }; +} + +#endif /* INC_STA_TOGGLE_HPP_ */ diff --git a/App/Src/startup.cpp b/App/Src/startup.cpp index 9b5186a..646ca9c 100644 --- a/App/Src/startup.cpp +++ b/App/Src/startup.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -32,7 +33,9 @@ namespace sta // ###### Register different threads for different states here. ###### // The dummy task runs for state 0. - Manager::instance()->registerThread(std::make_shared("Dummy"), {0}); + Manager::instance()->registerThread(std::make_shared("State 0"), {0}); + Manager::instance()->registerThread(std::make_shared("State 1"), {1}); + Manager::instance()->registerThread(std::make_shared(), {0, 1}); } } // namespace tacos } // namespace sta diff --git a/App/Src/tasks/toggle.cpp b/App/Src/tasks/toggle.cpp new file mode 100644 index 0000000..f4efe41 --- /dev/null +++ b/App/Src/tasks/toggle.cpp @@ -0,0 +1,37 @@ +/* + * toggle.cpp + * + * Created on: Nov 10, 2023 + * Author: Dario + */ + +#include +#include +#include + +namespace demo +{ + Toggle::Toggle() + : sta::tacos::TacosThread{ "Toggle", osPriorityNormal } + { + + } + + void Toggle::init() + { + + } + + void Toggle::func() + { + osDelay(5000); + + uint16_t state = sta::tacos::Statemachine::instance()->getCurrentState(); + uint16_t next = 1 - state; + + STA_DEBUG_PRINTLN("Toggle!"); + sta::tacos::Statemachine::instance()->requestStateTransition(state, next, 0); + } +} + + diff --git a/Libs/rtos2-utils b/Libs/rtos2-utils index c609dc8..615900f 160000 --- a/Libs/rtos2-utils +++ b/Libs/rtos2-utils @@ -1 +1 @@ -Subproject commit c609dc81cc70327948aa8173c9d6ad804ae7a642 +Subproject commit 615900f16e246f3f33eebb9b022b7da3c62b7162 From a70dc00f4c06d0a178cbc886c2fb068abf6e2f53 Mon Sep 17 00:00:00 2001 From: dario Date: Tue, 21 Nov 2023 19:47:41 +0100 Subject: [PATCH 4/7] Added new task for testing --- .settings/language.settings.xml | 4 ++-- App/Inc/sta/config.hpp | 2 +- App/Inc/tasks/disturb.hpp | 26 ++++++++++++++++++++++++ App/Inc/tasks/dummy.hpp | 1 - App/Src/startup.cpp | 3 +++ App/Src/tasks/disturb.cpp | 35 +++++++++++++++++++++++++++++++++ App/Src/tasks/dummy.cpp | 2 -- App/Src/tasks/toggle.cpp | 17 +++++++++++++++- Libs/sta-core | 2 +- 9 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 App/Inc/tasks/disturb.hpp create mode 100644 App/Src/tasks/disturb.cpp diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 13cbd4a..fa3c189 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/App/Inc/sta/config.hpp b/App/Inc/sta/config.hpp index ac9da2c..667052e 100644 --- a/App/Inc/sta/config.hpp +++ b/App/Inc/sta/config.hpp @@ -33,7 +33,7 @@ #define STA_TACOS_STATEMACHINE_PRIORITY osPriorityNormal // Statemachine settings. Here, we only have a single state which is also the initial state. -#define STA_TACOS_NUM_STATES 2 +#define STA_TACOS_NUM_STATES 3 #define STA_TACOS_INITIAL_STATE 0 #endif /* INC_STA_CONFIG_HPP_ */ diff --git a/App/Inc/tasks/disturb.hpp b/App/Inc/tasks/disturb.hpp new file mode 100644 index 0000000..4919fee --- /dev/null +++ b/App/Inc/tasks/disturb.hpp @@ -0,0 +1,26 @@ +/* + * disturb.hpp + * + * Created on: Nov 20, 2023 + * Author: Dario + */ + +#ifndef INC_TASKS_DISTURB_HPP_ +#define INC_TASKS_DISTURB_HPP_ + +#include + +namespace demo +{ + class DisturbTask : public sta::tacos::TacosThread { + public: + DisturbTask(); + + void init() override; + + void func() override; + }; +} // namespace demo + + +#endif /* INC_TASKS_DISTURB_HPP_ */ diff --git a/App/Inc/tasks/dummy.hpp b/App/Inc/tasks/dummy.hpp index 0c7de2b..aea9df6 100644 --- a/App/Inc/tasks/dummy.hpp +++ b/App/Inc/tasks/dummy.hpp @@ -15,7 +15,6 @@ namespace demo class DummyTask : public sta::tacos::TacosThread { public: DummyTask(const char* name); - ~DummyTask() override; void init() override; diff --git a/App/Src/startup.cpp b/App/Src/startup.cpp index 646ca9c..87dfde0 100644 --- a/App/Src/startup.cpp +++ b/App/Src/startup.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,9 @@ namespace sta // The dummy task runs for state 0. Manager::instance()->registerThread(std::make_shared("State 0"), {0}); Manager::instance()->registerThread(std::make_shared("State 1"), {1}); + Manager::instance()->registerThread(std::make_shared("State 2 - FAIL"), {2}); Manager::instance()->registerThread(std::make_shared(), {0, 1}); + Manager::instance()->registerThread(std::make_shared(), {0, 1}); } } // namespace tacos } // namespace sta diff --git a/App/Src/tasks/disturb.cpp b/App/Src/tasks/disturb.cpp new file mode 100644 index 0000000..8315c96 --- /dev/null +++ b/App/Src/tasks/disturb.cpp @@ -0,0 +1,35 @@ +/* + * disturb.cpp + * + * Created on: Nov 20, 2023 + * Author: Dario + */ + +#include +#include +#include + +namespace demo +{ + DisturbTask::DisturbTask() + : sta::tacos::TacosThread("Disturb", osPriorityNormal) + { + + } + + void DisturbTask::init() + { + + } + + void DisturbTask::func() + { + STA_DEBUG_PRINTLN(this->getName()); + + sta::tacos::Statemachine::instance()->stateChangeEvent.wait(sta::tacos::EventFlags::ALL, osWaitForever); + + uint16_t currentState = sta::tacos::Statemachine::instance()->getCurrentState(); + sta::tacos::Statemachine::instance()->requestTimedStateTransition(currentState, 2, 4000, 0); + } +} // namespace demo + diff --git a/App/Src/tasks/dummy.cpp b/App/Src/tasks/dummy.cpp index 5046319..41b0a8c 100644 --- a/App/Src/tasks/dummy.cpp +++ b/App/Src/tasks/dummy.cpp @@ -19,8 +19,6 @@ namespace demo } - DummyTask::~DummyTask(){} - void DummyTask::init() { diff --git a/App/Src/tasks/toggle.cpp b/App/Src/tasks/toggle.cpp index f4efe41..e43b296 100644 --- a/App/Src/tasks/toggle.cpp +++ b/App/Src/tasks/toggle.cpp @@ -26,8 +26,23 @@ namespace demo { osDelay(5000); + // Have we been requested to terminate while waiting? + if (!isRunning()) + return; + + // Do some important stuff... + uint16_t state = sta::tacos::Statemachine::instance()->getCurrentState(); - uint16_t next = 1 - state; + uint16_t next; + + if (state != 2) + { + next = 1 - state; + } + else + { + next = 0; + } STA_DEBUG_PRINTLN("Toggle!"); sta::tacos::Statemachine::instance()->requestStateTransition(state, next, 0); diff --git a/Libs/sta-core b/Libs/sta-core index 71170d4..4da1f0b 160000 --- a/Libs/sta-core +++ b/Libs/sta-core @@ -1 +1 @@ -Subproject commit 71170d4cea428fffb05fc2666201d390ff411fc4 +Subproject commit 4da1f0bb7dd48f89e9dd5ee0ec181638894e55e2 From 2b4e6341798890f63f898295365074444efb528e Mon Sep 17 00:00:00 2001 From: dario Date: Wed, 29 Nov 2023 20:12:45 +0100 Subject: [PATCH 5/7] Changed TacosThread termination to work correctly; fixed bugs in the testing --- .cproject | 1 + .settings/language.settings.xml | 4 ++-- App/Src/startup.cpp | 5 +++++ App/Src/tasks/toggle.cpp | 12 ++++-------- Libs/rtos2-utils | 2 +- Libs/sta-core | 2 +- Tacos/src/thread.cpp | 11 ++++++++--- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.cproject b/.cproject index c112998..400127d 100644 --- a/.cproject +++ b/.cproject @@ -25,6 +25,7 @@