D21 implementation of the timer interface.
Copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.
Functions | |
void | countdown (Timer *timer, unsigned int timeout) |
count down timer function. More... | |
void | countdown_ms (Timer *timer, unsigned int timeout) |
count down timer function. More... | |
char | expired (Timer *timer) |
Timer expiry check function. More... | |
uint32_t | getTimeInMillis (void) |
Get time in milliseconds. More... | |
void | InitTimer (Timer *timer) |
Timer intialization function. More... | |
int | left_ms (Timer *timer) |
Time avaible for timer expiry function. More... | |
Variables | |
volatile uint32_t | ms_ticks |
SysTick counter to avoid busy wait delay. More... | |
void countdown | ( | Timer * | timer, |
unsigned int | timeout | ||
) |
count down timer function.
Create a timer (seconds)
[in] | timer | Timer to be started. |
[in] | timeout | timeout in seconds. |
References Timer::end_time, getTimeInMillis(), and Timer::offset.
Referenced by addToAckWaitList(), cycle(), keepalive(), MQTTConnect(), and subscribeToShadowActionAcks().
void countdown_ms | ( | Timer * | timer, |
unsigned int | timeout | ||
) |
count down timer function.
Create a timer (milliseconds)
[in] | timer | Timer to be started. |
[in] | timeout | timeout in milliseconds. |
References Timer::end_time, getTimeInMillis(), and Timer::offset.
Referenced by handleReconnect(), keepalive(), MQTTConnect(), MQTTDisconnect(), MQTTPublish(), MQTTResubscribe(), MQTTSubscribe(), MQTTUnsubscribe(), and MQTTYield().
char expired | ( | Timer * | timer | ) |
Timer expiry check function.
Check if a timer is expired.
[in] | timer | Timer to be checked. |
References Timer::end_time, getTimeInMillis(), and Timer::offset.
Referenced by HandleExpiredResponseCallbacks(), handleReconnect(), keepalive(), MQTTYield(), sendPacket(), subscribeToShadowActionAcks(), and waitfor().
uint32_t getTimeInMillis | ( | void | ) |
Get time in milliseconds.
References ms_ticks.
Referenced by countdown(), countdown_ms(), expired(), and left_ms().
void InitTimer | ( | Timer * | timer | ) |
Timer intialization function.
Initialize a timer.
[in] | timer | Timer to be intialized. |
References Timer::end_time, and Timer::offset.
Referenced by addToAckWaitList(), keepalive(), MQTTClient(), MQTTConnect(), MQTTDisconnect(), MQTTPublish(), MQTTResubscribe(), MQTTSubscribe(), MQTTUnsubscribe(), MQTTYield(), and subscribeToShadowActionAcks().
int left_ms | ( | Timer * | timer | ) |
Time avaible for timer expiry function.
Check the time remaining on a give timer.
[in] | timer | Timer to be started. |
References Timer::end_time, getTimeInMillis(), and Timer::offset.
Referenced by readPacket(), and sendPacket().
volatile uint32_t ms_ticks |
SysTick counter to avoid busy wait delay.
TLS read functionality.
Referenced by button_press_duration(), getTimeInMillis(), and SysTick_Handler().