mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
esp_timer: alias esp_timer_get_time
alias esp_timer_get_time to improve performance
This commit is contained in:
@@ -63,11 +63,14 @@ uint64_t IRAM_ATTR esp_timer_impl_get_counter_reg(void)
|
||||
return systimer_hal_get_counter_value(SYSTIMER_COUNTER_0);
|
||||
}
|
||||
|
||||
uint64_t IRAM_ATTR esp_timer_impl_get_time(void)
|
||||
int64_t IRAM_ATTR esp_timer_impl_get_time(void)
|
||||
{
|
||||
return systimer_hal_get_time(SYSTIMER_COUNTER_0);
|
||||
}
|
||||
|
||||
// Xtensa architecture doesn't have tail call optimization, using alias here can improve performance somehow
|
||||
int64_t esp_timer_get_time(void) __attribute__((alias("esp_timer_impl_get_time")));
|
||||
|
||||
void IRAM_ATTR esp_timer_impl_set_alarm(uint64_t timestamp)
|
||||
{
|
||||
portENTER_CRITICAL_SAFE(&s_time_update_lock);
|
||||
|
Reference in New Issue
Block a user