mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-18 21:43:37 -04:00
* 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
26 lines
470 B
C++
26 lines
470 B
C++
#pragma once
|
|
|
|
#include "Message.hpp"
|
|
|
|
namespace sys
|
|
{
|
|
|
|
class Timer;
|
|
|
|
class TimerMessage : public SystemMessage
|
|
{
|
|
Timer *timer = nullptr;
|
|
|
|
public:
|
|
TimerMessage(Timer *timer) : SystemMessage(SystemMessageType::Timer, ServicePowerMode::Active), timer(timer)
|
|
{
|
|
type = Type::System;
|
|
}
|
|
|
|
[[nodiscard]] auto getTimer() const -> Timer *
|
|
{
|
|
return timer;
|
|
}
|
|
};
|
|
} // namespace sys
|