mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-04-05 22:47:00 +00:00
big update:
- display update - timer changed to ms - allow connections just when connected
This commit is contained in:
parent
c96a0310ae
commit
2c78a002ab
19 changed files with 332 additions and 351 deletions
|
|
@ -1,28 +1,28 @@
|
|||
#include "Timer.h"
|
||||
|
||||
Timer::Timer() : _timeout_sec(0), _timeout(0) {
|
||||
Timer::Timer() : _timeout_ms(0), _nextTimeout(0) {
|
||||
}
|
||||
|
||||
void Timer::setTimeout(const time_t timeout_sec) {
|
||||
_timeout_sec = timeout_sec;
|
||||
void Timer::setTimeout(const uint32_t timeout_ms) {
|
||||
_timeout_ms = timeout_ms;
|
||||
}
|
||||
|
||||
time_t Timer::getTriggerTime() const {
|
||||
return _timeout;
|
||||
time_t Timer::getTriggerTimeInSec() const {
|
||||
return (_nextTimeout - millis()) / 1000;
|
||||
}
|
||||
|
||||
bool Timer::isActive() const {
|
||||
return _timeout != 0;
|
||||
return _nextTimeout != 0;
|
||||
}
|
||||
|
||||
void Timer::reset() {
|
||||
_timeout = 0;
|
||||
_nextTimeout = 0;
|
||||
}
|
||||
|
||||
bool Timer::check() {
|
||||
return now() > _timeout;
|
||||
return millis() > _nextTimeout;
|
||||
}
|
||||
|
||||
void Timer::start() {
|
||||
_timeout = now() + _timeout_sec;
|
||||
_nextTimeout = millis() + _timeout_ms;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue