mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-04-05 22:47:00 +00:00
big changes:
- task manager working now in round robbin and returning after every task to arduino - adding a system class which is managing all bigger things
This commit is contained in:
parent
5a1a091fc7
commit
52d41dd9f6
27 changed files with 216 additions and 121 deletions
28
lib/System/Timer.cpp
Normal file
28
lib/System/Timer.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include "Timer.h"
|
||||
|
||||
Timer::Timer() : _timeout_sec(0), _timeout(0) {
|
||||
}
|
||||
|
||||
void Timer::setTimeout(const time_t timeout_sec) {
|
||||
_timeout_sec = timeout_sec;
|
||||
}
|
||||
|
||||
time_t Timer::getTriggerTime() const {
|
||||
return _timeout;
|
||||
}
|
||||
|
||||
bool Timer::isActive() const {
|
||||
return _timeout != 0;
|
||||
}
|
||||
|
||||
void Timer::reset() {
|
||||
_timeout = 0;
|
||||
}
|
||||
|
||||
bool Timer::check() {
|
||||
return now() > _timeout;
|
||||
}
|
||||
|
||||
void Timer::start() {
|
||||
_timeout = now() + _timeout_sec;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue