esp_timer: allow querying the timer before esp_timer_init is called

This commit is contained in:
Ivan Grokhotkov
2021-07-20 03:31:25 +02:00
committed by Cao Sen Miao
parent e525964f67
commit 249abb3fe8
6 changed files with 68 additions and 25 deletions

View File

@@ -83,11 +83,28 @@ typedef struct {
bool skip_unhandled_events; //!< Skip unhandled events for periodic timers
} esp_timer_create_args_t;
/**
* @brief Minimal initialization of esp_timer
*
* @note This function is called from startup code. Applications do not need
* to call this function before using other esp_timer APIs.
*
* This function can be called very early in startup process, after this call
* only esp_timer_get_time function can be used.
*
* @return
* - ESP_OK on success
*/
esp_err_t esp_timer_early_init(void);
/**
* @brief Initialize esp_timer library
*
* @note This function is called from startup code. Applications do not need
* to call this function before using other esp_timer APIs.
* Before calling this function, esp_timer_early_init must be called by the
* startup code.
*
* @return
* - ESP_OK on success