Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1).
Can anyone help me ?
I am using the Arduino IDE 2.2.1 Best regards
John
Code: Select all
// ESP32 2.0.18
// Radio control Flysky FS -I
// PPM signal from Radio control
volatile uint64_t timer_lesen = 0;
volatile int flag_fa = 0;
volatile int ch_nr = 0;
volatile int ch[12];
hw_timer_t* timer1 = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;
void ARDUINO_ISR_ATTR onTimer() { // Interrupt on pin 13
portENTER_CRITICAL_ISR(&timerMux);
if (flag_fa == 0) {
timerStart(timer1);
ch_nr++;
flag_fa = 1;
}
else {
timerStop(timer1);
timer_lesen = timerRead(timer1);
timerWrite(timer1, 0);
if (timer_lesen > 10000) ch_nr = 0; // Synchronisation of the PPM signal
ch[ch_nr] = timer_lesen; // Data from Synchronisation of the PPM signal
// ch_nr = Channel number 1 to 6
flag_fa = 0;
}
portEXIT_CRITICAL_ISR(&timerMux);
}
void setup() {
Serial.begin(115200);
// Decoder PPM Pin13
pinMode(13, INPUT_PULLUP); // PPM Signal on PIN 13
timer1 = timerBegin(0, 30, true);
attachInterrupt(digitalPinToInterrupt(13), &onTimer, CHANGE);
timerWrite(timer1, 0);
}
void loop() {
portENTER_CRITICAL(&timerMux);
Serial.print(ch[0]);
Serial.print(" ");
Serial.print(ch[1]);
Serial.print(" ");
Serial.print(ch[2]);
Serial.print(" ");
Serial.println(ch[3]);
Serial.println(" ");
portEXIT_CRITICAL(&timerMux);
delay(3); // Error delay under 3 ms !!
}[/code]