esp_system: introduce system time functions

- Introduce system time function and concept of system time provider.
esp_timer is system time provider when present.
- Set the reference point for system time, g_startup_time.
- Use the system time functions in newlib instead of calling esp_timer
functions directly
This commit is contained in:
Renz Bagaporo
2020-06-23 16:46:06 +08:00
parent 5785e4dfb6
commit 346cf4430d
14 changed files with 172 additions and 31 deletions
@@ -61,6 +61,16 @@ void esp_reset_reason_set_hint(esp_reset_reason_t hint);
*/
esp_reset_reason_t esp_reset_reason_get_hint(void);
/**
* @brief Set function which provides `esp_system_get_time`.
*
* @param time_fn function which provides system time
* @param resolution resolution in microseconds of the time provider function specified
*/
void esp_system_set_time_provider(esp_system_time_fn_t time_fn, uint32_t resolution);
#ifdef __cplusplus
}
#endif