mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-18 21:43:37 -04:00
EGD-2955 EGD-3588 Timers fully refactored & updated (#721)
* Timers now are Application thread safe * Timers now have consistent API independend of Application (no more c style timers) * Timers can have either: callback or override onTimer() method - this way we can create more complicated timers or just use existing ones * gui::Timer added via adapter class GuiTimer to decouple sys::Timer with gui::Timer * Fixed race in wrapper * Updated docs * fixed using std and cpp_freertos and DataReceivedHandler hidden in Application.hpp
This commit is contained in:
@@ -303,25 +303,6 @@ namespace sys
|
||||
return ReturnCodes::Success;
|
||||
}
|
||||
|
||||
void SystemManager::TickHandler(uint32_t id)
|
||||
{
|
||||
if (id == pingPongTimerID) {
|
||||
|
||||
for (auto &w : servicesList) {
|
||||
if (w->pingTimestamp == 0) {
|
||||
// no reponse for ping messages, restart system
|
||||
LOG_FATAL("%s", (w->GetName() + " failed to response to ping message").c_str());
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
w->pingTimestamp = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Bus::SendBroadcast(std::make_shared<SystemMessage>(SystemMessageType::Ping), this);
|
||||
}
|
||||
}
|
||||
|
||||
Message_t SystemManager::DataReceivedHandler(DataMessage * /*msg*/, ResponseMessage * /*resp*/)
|
||||
{
|
||||
return std::make_shared<ResponseMessage>();
|
||||
@@ -331,8 +312,6 @@ namespace sys
|
||||
{
|
||||
LOG_DEBUG("Invoking closing procedure...");
|
||||
|
||||
DeleteTimer(pingPongTimerID);
|
||||
|
||||
// We are going to remove services in reversed order of creation
|
||||
CriticalSection::Enter();
|
||||
std::reverse(servicesList.begin(), servicesList.end());
|
||||
|
||||
Reference in New Issue
Block a user