Looking at your source code, I believe that what you mean is that you re-declared Delay_Cnt as a SIGNED, not an unsigned.
It WAS declared as an unsigned, always has been that way from the original authors of the firmware, has never been changed,
and to my knowledge has never caused any issues.
Just exactly what part of calibration is/was not working because of this “bug”? Delay_Cnt’s purpose is as a counter for the
Delayms function and a countdown for the keystroke time selection delays, all of which to my knowledge are working fine.
I will grant you that it probably makes more theoretical sense to declare it as a signed, since unsigned vars can “roll under”
if brought below zero and cause problems, but they DO go to zero, and CAN be tested as such. As used here, I see no part
of the program that can force it to go below zero. The TIM3_IRQHandler is the only function that can decrease this variable,
and it resets it to 0 any time it’s 20 OR less, otherwise decreasing it by 20, so the original author certainly was aware of
potential problems and took care to avoid such.
I will also grant you that I have not recalibrated my devices for some time, so if there are any problems with calibration
could you be more specific? I would rather like to avoid drudging through the entire calibration procedure to check this out…
By the way, I appreciate your work in splitting the programs, very useful.