So I have this weird issue with my Hachi firmware, where it’s very responsive to button presses while running (clocked externally) but not so much when it’s not running.
As far as I can tell, the issue is in DigitalInputs::CheckIfChanged(). Specifically this line:
if ( dHwData[indexDigital].digitalHWState != dHwData[indexDigital].digitalHWStatePrev) { // and bounce time elapsed // REVIEW BOUNCE ROUTINE
If I quickly tap a button while Hachi is running, it catches it fine. If it’s not running, the if-check fails and there’s no response. If I hold the button a little longer, it gets picked up. There’s a comment there about checking the bounce time – where is that check done? and could something be changing the bounce time?