fix timer collision in role switch

Closes https://github.com/espressif/esp-idf/issues/7203
This commit is contained in:
jincheng
2021-07-29 16:56:24 +08:00
parent 2c49af9e75
commit a523dd3ede
5 changed files with 41 additions and 1 deletions

View File

@@ -318,3 +318,14 @@ uint32_t osi_time_get_os_boottime_ms(void)
{
return (uint32_t)(esp_timer_get_time() / 1000);
}
bool osi_alarm_is_active(osi_alarm_t *alarm)
{
assert(alarm != NULL);
if (alarm->alarm_hdl != NULL) {
return esp_timer_is_active(alarm->alarm_hdl);
}
return false;
}

View File

@@ -77,4 +77,8 @@ period_ms_t osi_alarm_get_remaining_ms(const osi_alarm_t *alarm);
uint32_t osi_time_get_os_boottime_ms(void);
// This function returns whether the given |alarm| is active or not.
// Return true if active, false otherwise.
bool osi_alarm_is_active(osi_alarm_t *alarm);
#endif /*_ALARM_H_*/