-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
If I define a timer like:
hw_timer_t * timer = NULL;
void StartTimer(void) {
timer = timerBegin(0, 80, true);
timerAttachInterrupt(timer, &timer100msec, true);
timerAlarmWrite(timer, 100000, true);
timerAlarmEnable(timer);
Serial.println("Timer started");
}
void StopTimer(void) {
timerDetachInterrupt(timer);
timerStop(timer);
timerAlarmDisable(timer);
timerEnd(timer);
timer = NULL;
Serial.println("Timer stopped");
}
and start the timer in the SW then the OTA upgrade works very stuttery and breaks often (no response). I have to repeat more times for successful OTA programming. Serial flashing is no problem. First I try the timer stop with the command "timerEnd(timer)" only and add one by one command. Nothing did help.
This doesn't help, too:
ArduinoOTA.onStart( {
String type;
StopTimer();
if (ArduinoOTA.getCommand() == U_FLASH)
type = "sketch";
else // U_SPIFFS
type = "filesystem";
Serial.println("Start updating " + type);
});