AVR error incrementing unsigned long variable inside interrupt
Posted: Fri Apr 23, 2021 12:38 am
Hello there.
I cant solve this error.
Incrementing an unsigned long variable inside a timer interrupt (atmega2560), when it reaches the border limit of 0xFF, at the next step, 0x100, it gets corrupted.
Tried with C icon and declred it in supplementary code as VOLATILE but no way.
Tried also to understand as implementing an ATOMIC function but without succes.
Does someone drive me in the right direction?
I cant solve this error.
Incrementing an unsigned long variable inside a timer interrupt (atmega2560), when it reaches the border limit of 0xFF, at the next step, 0x100, it gets corrupted.
Tried with C icon and declred it in supplementary code as VOLATILE but no way.
Tried also to understand as implementing an ATOMIC function but without succes.
Does someone drive me in the right direction?