Linux implementation of the timer interface.
More...
#include <stddef.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include "timer_platform.h"
| void countdown_ms |
( |
Timer * |
, |
|
|
uint32_t |
|
|
) |
| |
Sets the timer to expire in a specified number of milliseconds.
- Parameters
-
| Timer | - pointer to the timer to be set to expire in milliseconds |
| uint32_t | - set the timer to expire in this number of milliseconds |
| void countdown_sec |
( |
Timer * |
, |
|
|
uint32_t |
|
|
) |
| |
Sets the timer to expire in a specified number of seconds.
- Parameters
-
| Timer | - pointer to the timer to be set to expire in seconds |
| uint32_t | - set the timer to expire in this number of seconds |
| bool has_timer_expired |
( |
Timer * |
| ) |
|
Call this function passing in a timer to check if that timer has expired.
- Parameters
-
| Timer | - pointer to the timer to be checked for expiration |
- Returns
- bool - true = timer expired, false = timer not expired
| void init_timer |
( |
Timer * |
| ) |
|
Performs any initialization required to the timer passed in.
- Parameters
-
| Timer | - pointer to the timer to be initialized |
| uint32_t left_ms |
( |
Timer * |
| ) |
|
Checks the input timer and returns the number of milliseconds remaining on the timer.
- Parameters
-
| Timer | - pointer to the timer to be set to checked |
- Returns
- int - milliseconds left on the countdown timer