esp_timer: alias esp_timer_get_time

alias esp_timer_get_time to improve performance
This commit is contained in:
morris
2020-03-31 18:44:37 +08:00
parent 2d1885b906
commit 890fc0fe67
6 changed files with 14 additions and 12 deletions

View File

@@ -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);