When compiling code with gcc 10.2.1 on a Raspberry Pi 3 running Debian Bullseye (amrhf / 32bit) I have noticed that function clkPulseLength() add an incorrect behaviour identifying clock pulse length.
I have found this would happen because -O2 gcc compiler option.
To avoid compiler the compiler optimization that was discarding variable initializations in switch() scope, I have modified the code so it wouldn't skip it.
When compiling code with gcc 10.2.1 on a Raspberry Pi 3 running Debian Bullseye (amrhf / 32bit) I have noticed that function clkPulseLength() add an incorrect behaviour identifying clock pulse length. I have found this would happen because
-O2
gcc compiler option. To avoid compiler the compiler optimization that was discarding variable initializations in switch() scope, I have modified the code so it wouldn't skip it.