Spillway
A vibration sensor on PA0 fires rapid interrupt bursts during machine operation. A colleague wrote an ISR-to-main telemetry pipeline: the EXTI0 ISR captures incrementing sample values (1, 2, 3, ...) into a FIFO queue, and after the burst completes the main loop drains the queue over UART.
Expected UART output format: SAMPLE:<value>\n for each sample drained from the queue TOTAL:<n>\n number of samples successfully drained DROPPED:<n>\n number of samples the ISR rejected (backpressure)
The queue holds up to 8 entries. When the queue is full, new samples should be dropped, not written. The ISR must track how many were rejected.
Example: 4 pulses → SAMPLE:1, SAMPLE:2, SAMPLE:3, SAMPLE:4, TOTAL:4, DROPPED:0 Example: 12 pulses → SAMPLE:1 through SAMPLE:8, TOTAL:8, DROPPED:4
The starter code compiles without warnings but produces incorrect output. Find and fix all the bugs.