Deluge

You inherited a motor controller that monitors two external interrupt sources: an end-stop limit switch on PA0 (EXTI0) and a rotary encoder on PA1 (EXTI1). Each ISR increments a counter, and after a run period the firmware prints the totals.

The code compiles without warnings, but the output never appears. One of the interrupt sources appears to be flooding the CPU, starving the main loop entirely.

After the run period the firmware prints LIMIT:<count> and ENC:<count> on separate lines, then OK. Each count is the number of events registered on that input during the run.

The starter code is compiled with -O2. Find and fix all the bugs.

Loading the interactive arena.