Page 1 of 1

Timer AutoReload canceled

Posted: Sat Oct 21, 2023 7:07 pm
by dh6wm-12
Hello,

I have the problem that on my ESP8266 the AutoReload or countdown start no longer works when a certain operation is carried out. I haven't figured out exactly what operation triggers this.
When I output the value of timer1 in the asynchronous loop function, it ends counting after the first interrupt because the timer remains at the reload value. Does anyone know this behavior?

Using the exclusion process I found a line of code that triggers the behavior. The line should describe a string variable with a random RGB16 HEX value.
The string is later broken down into three RGB values ​​in the code.

  1. color = String(random(0x0, 0xFFFFFF), HEX);

Best Regards
Wilhelm

Re: Timer AutoReload canceled

Posted: Sun Oct 22, 2023 4:34 pm
by lbernstone
This forum is for esp32. Please post 8266 questions at https://esp32.com/viewforum.php?f=50

Re: Timer AutoReload canceled

Posted: Mon Oct 23, 2023 3:30 am
by ESP_Sprite
Moving to ESP8266 subforum.

Re: Timer AutoReload canceled

Posted: Mon Oct 23, 2023 6:42 pm
by hobby_guy
Can you paste your full code?

The line you identified modifies the color variable. Does this happen within the ISR (the interrupt handler/method) for the counter? If so, volatile String color; has to be declared as volatile, or the program will crash.