Timer AutoReload canceled

dh6wm-12
Posts: 1
Joined: Sat Oct 21, 2023 6:50 pm

Timer AutoReload canceled

Postby dh6wm-12 » Sat Oct 21, 2023 7:07 pm

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

lbernstone
Posts: 828
Joined: Mon Jul 22, 2019 3:20 pm

Re: Timer AutoReload canceled

Postby lbernstone » Sun Oct 22, 2023 4:34 pm

This forum is for esp32. Please post 8266 questions at https://esp32.com/viewforum.php?f=50

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Timer AutoReload canceled

Postby ESP_Sprite » Mon Oct 23, 2023 3:30 am

Moving to ESP8266 subforum.

hobby_guy
Posts: 20
Joined: Sat Jan 29, 2022 3:29 pm

Re: Timer AutoReload canceled

Postby hobby_guy » Mon Oct 23, 2023 6:42 pm

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.

Who is online

Users browsing this forum: No registered users and 4 guests