mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
sys/evtimer: add helper for retrieving the current system time
This commit is contained in:
parent
fc6b586919
commit
47b8439cd8
@ -46,6 +46,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "xtimer.h"
|
||||
#include "timex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -105,6 +106,22 @@ void evtimer_del(evtimer_t *evtimer, evtimer_event_t *event);
|
||||
*/
|
||||
void evtimer_print(const evtimer_t *evtimer);
|
||||
|
||||
/**
|
||||
* @brief Return the current system time in msec
|
||||
*/
|
||||
static inline uint32_t evtimer_now_msec(void)
|
||||
{
|
||||
return xtimer_now_usec64() / US_PER_MS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the current system time in minutes
|
||||
*/
|
||||
static inline uint32_t evtimer_now_min(void)
|
||||
{
|
||||
return xtimer_now_usec64() / (US_PER_SEC * SEC_PER_MIN);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user