I was programming an arduino uno with an LCD attached. If I press a button I send a byte over bluetooth and I get a respons. This response controlled the LCD
I use a switch-case to print the texts.
All of the sudden some texts would just not get printed. I spent hours and hours in finding what I broke. Only ~5 cases still worked and the others did not.
I checked incomming data, it was not changed. I followed and logged the data stream and the switch-case should do the exact same as it did before. But yet it did not. I printed what the switch-variable was prior to entering the switch-case and yet the case in question was not run. This variable is not changed by an ISR or anything. So why was the case not run?
Now I have fixed the issue and it turns out I was wrestling with a compiler-bug.
The thing what I did which fixed the bug was: I swapped the position of a few cases. I simply Ctrl-X'ed one case and Ctrl-V'ed it above another. And suddenly it worked again just like this afternoon.
It was obvious to me that somehow the compiler broke the jump-table or something.
I've been using the IDE 1.8.12 as well arduino-cli (installed 2 days ago). So I don't know or why it happened, just that it did.
Is it worth reporting this somewhere?? I cannot reproduce the bug nor do I have copies of the broken software.