esp_timer: correct startup time

This commit is contained in:
Renz Bagaporo
2021-03-08 23:01:40 +08:00
parent 5a90113136
commit 74de5a7c58
4 changed files with 63 additions and 18 deletions

View File

@@ -446,9 +446,7 @@ esp_err_t esp_timer_init(void)
}
#if CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER
// [refactor-todo] this logic, "esp_rtc_get_time_us() - g_startup_time", is also
// the weak definition of esp_system_get_time; find a way to remove this duplication.
esp_timer_private_advance(esp_rtc_get_time_us() - g_startup_time);
esp_timer_impl_init_system_time();
#endif
return ESP_OK;
@@ -600,17 +598,3 @@ int64_t IRAM_ATTR esp_timer_get_next_alarm(void)
}
return next_alarm;
}
// Provides strong definition for system time functions relied upon
// by core components.
#if CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER
int64_t IRAM_ATTR esp_system_get_time(void)
{
return esp_timer_get_time();
}
uint32_t IRAM_ATTR esp_system_get_time_resolution(void)
{
return 1000;
}
#endif