|
| timer () noexcept |
|
| timer (const qOS::duration_t tTime) |
| Initializes the instance of the timer with the specified expiration time. Timer will start armed.
|
|
bool | set (const qOS::duration_t tTime) noexcept |
| Set the expiration time for a timer. On success, the timer gets armed immediately.
|
|
void | disarm (void) noexcept |
| Disarms the timer object.
|
|
void | reload (void) noexcept |
| Reload the timer with the previous specified time.
|
|
bool | status (void) const noexcept |
| Get the current status of the Timer (Armed or Disarmed)
|
|
bool | reloadIfExpired (const qOS::duration_t tTime) noexcept |
| Non-Blocking timer check with automatic arming.
|
|
bool | reloadIfExpired (void) noexcept |
| Non-Blocking timer check with automatic arming.
|
|
qOS::clock_t | remaining (void) const noexcept |
| Retrieve the remaining time in epochs.
|
|
qOS::clock_t | elapsed (void) const noexcept |
| Retrieve the elapsed time in epochs.
|
|
bool | expired (void) const noexcept |
| Non-Blocking timer check.
|
|
bool | deadLineCheck (void) const noexcept |
| Check if the specified deadline for has been reached.
|
|
qOS::clock_t | getInterval (void) const noexcept |
| Retrieve the timer interval value.
|
|
timer & | operator= (const qOS::duration_t tTime) |
| Set the expiration time for a timer and gets armed immediately.
|
|
timer & | operator= (const bool en) |
| Disarm or reload the timer.
|
|
bool | operator() (void) const |
| Non-Blocking timer check.
|
|
bool | operator() (const qOS::duration_t tTime) |
| Set the expiration time for a timer and gets armed immediately.
|
|
void | operator() (const bool en) |
| Disarm or reload the timer.
|
|
| operator bool () const noexcept |
| Non-Blocking timer check.
|
|
A non-blocking Timer object.
Timers are an essential extension as they allow for accurate and efficient timekeeping without blocking tasks. Using timers enables the embedded application to perform other critical tasks while the timer is running in the background. Timers also provide flexibility in the event that the timer needs to be paused, restarted, or adjusted on the fly. This can be particularly useful in applications that require dynamic timing or have unpredictable event intervals.
Non-Blocking timer check with automatic arming.
Behavior: If disarmed, it gets armed immediately with the specified time.
If armed, the time argument is ignored and the API only checks for expiration. When the time expires, the timer gets armed immediately taking the specified time.
- Note
- After the timer expiration, this method re-arms the timer
-
The OS must be running before using a timer.
-
The expiration time should be at least, two times greater than the clock-Tick.
- Parameters
-
[in] | tTime | The expiration time given in milliseconds. |
- Returns
- Returns
true
on success, otherwise, returns false
.
- Note
- A disarmed timer also returns
false
.
bool qOS::timer::reloadIfExpired |
( |
void | | ) |
|
|
noexcept |
Non-Blocking timer check with automatic arming.
Behavior: If disarmed, it gets armed immediately with the previous specified time.
If armed, the API only checks for expiration. When the time expires, the timer gets armed immediately using the previously assigned time.
- Note
- After the timer expiration, this method re-arms the timer
-
The OS must be running before using a timer.
- Returns
- Returns
true
on success, otherwise, returns false
.
- Note
- A disarmed timer also returns
false
.