if (!is_initialized()) {
return ESP_ERR_INVALID_STATE;
}
- if (args->callback == NULL) {
+ if (args == NULL || args->callback == NULL || out_handle == NULL) {
return ESP_ERR_INVALID_ARG;
}
esp_timer_handle_t result = (esp_timer_handle_t) calloc(1, sizeof(*result));
esp_err_t IRAM_ATTR esp_timer_start_once(esp_timer_handle_t timer, uint64_t timeout_us)
{
+ if (timer == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
if (!is_initialized() || timer_armed(timer)) {
return ESP_ERR_INVALID_STATE;
}
esp_err_t IRAM_ATTR esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period_us)
{
+ if (timer == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
if (!is_initialized() || timer_armed(timer)) {
return ESP_ERR_INVALID_STATE;
}
esp_err_t IRAM_ATTR esp_timer_stop(esp_timer_handle_t timer)
{
+ if (timer == NULL) {
+ return ESP_ERR_INVALID_ARG;
+ }
if (!is_initialized() || !timer_armed(timer)) {
return ESP_ERR_INVALID_STATE;
}