Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gptimer): race on FSM state in gptimer_start() (IDFGH-13929) #14767

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/esp_driver_gptimer/src/gptimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,12 @@ esp_err_t gptimer_start(gptimer_handle_t timer)
portENTER_CRITICAL_SAFE(&timer->spinlock);
timer_ll_enable_alarm(timer->hal.dev, timer->timer_id, timer->flags.alarm_en);
timer_ll_enable_counter(timer->hal.dev, timer->timer_id, true);
atomic_store(&timer->fsm, GPTIMER_FSM_RUN);
portEXIT_CRITICAL_SAFE(&timer->spinlock);
} else {
ESP_RETURN_ON_FALSE_ISR(false, ESP_ERR_INVALID_STATE, TAG, "timer is not enabled yet");
}

atomic_store(&timer->fsm, GPTIMER_FSM_RUN);
return ESP_OK;
}

Expand Down
Loading