Blackout (85-blackout)
A colleague handed you a sensor sample logger and a complaint: it never flags anything. A run of captured readings streams in over UART1, and the logger is supposed to print one line per reading tagged OK or ALERT, then a count of how many alerts it saw. Plenty of readings sit well above the alert level, yet every run reports zero.
The strange part is that nothing looks broken. The output is short, clean, and internally consistent, so staring at it tells you almost nothing. Trace the control flow instead: a block you expect to run on every reading may not be running at all.
The stream is one decimal value per line, ending with a line that reads END. Readings at or above 500 are alerts. A reading of 65535 is the sensor's dropout marker and is not a real measurement, so it must be skipped.
The output starts with a LOG START line, then one R<value> line per real reading tagged OK or ALERT, then an ALERTS:<n> tally, and finally LOG END. A reading of 842 would print as "R842 ALERT", a reading of 61 as "R61 OK".
Find and fix the bug so the log reports every reading correctly.