Code: Select all
const esp_timer_create_args_t periodic_timer_args_bpm = {
.callback = &periodic_timer_callback_bpm,
/* name is optional, but may help identify the timer when debugging */
.name = "periodic"};
ESP_ERROR_CHECK(esp_timer_create(&periodic_timer_args_bpm, &periodic_timer_bpm));
/* The timer has been created but is not running yet */
ESP_ERROR_CHECK(esp_timer_start_periodic(periodic_timer_bpm, 2500));
Code: Select all
static void periodic_timer_callback_bpm(void *arg)
{
bpm_rise_signal = !bpm_rise_signal;
gpio_set_level(SYNC_OUT_PIN, bpm_rise_signal);
}