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:
Adam
2020-10-02 14:04:57 +02:00
committed by GitHub
parent 746c0decc0
commit f5f27d642f
119 changed files with 1078 additions and 764 deletions

View File

@@ -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());