Thanks for the attention. I need to make works a timer configuration for ESP32 on the Arduino IDE. I am using the ESP32 DevkitV1 board, IDE version 2.3.6. I compiled the code bellow, but the interrupt routine is not beeing called.
#include <Arduino.h>
hw_timer_t *timer = NULL; // Ponteiro para a estrutura do timer
#define DADO 4
void IRAM_ATTR onTimer()
{
digitalWrite(DADO, !digitalRead(DADO));
Serial.println("*");
}
void setup()
{
// Inicializa o timer: timer_id=0, prescaler=80, auto_reload=true
Serial.begin(9600);
timer = timerBegin(1000);
// Anexa a interrupção ao timer
timerAttachInterrupt(timer, &onTimer);
// Configura um alarme para 0,11 segundo (1.000 microssegundos)
timerWrite(timer, 1000);
// Habilita o alarme
timerAlarm(timer, 1000, true, 1000);
}
void loop()
{
char i = 0;
}