Black Box
A sensor on PA0 generates rapid interrupt pulses. Your EXTI0 ISR must capture incrementing sample values (1, 2, 3, ...) into a ring buffer with 8 slots. After the burst completes, the main loop drains the buffer and transmits each stored value over UART.
Expected UART output format: DATA:<value>\n (one line per sample read from buffer) COUNT:<n>\n (total number of samples read from buffer)
The ring buffer uses head/tail indices for write/read positions and a count to track occupancy. If more samples arrive than the buffer can hold, discard the excess (keep the first 8).
Example: 3 pulses → DATA:1, DATA:2, DATA:3, COUNT:3 Example: 8 pulses → DATA:1 through DATA:8, COUNT:8
The starter code compiles without warnings but produces incorrect output. Find and fix all the bugs.