Code: Select all
esp_timer_handle_t timerHandle;
const esp_timer_create_args_t timerArgs={
.callback = onTimer,
.arg = NULL,
.dispatch_method = ESP_TIMER_TASK,
.name = "Measurement",
.skip_unhandled_events = false
};
esp_timer_create(&timerArgs,&timerHandle);
Code: Select all
esp_timer_start_periodic(timerHandle,timeout_us);
esp_timer_stop(timerHandle));
Code: Select all
void onTimer(void *args){
// print a message from args, pass value on notification
}