Turnstile
A sensor on PA0 fires an interrupt each time an event occurs. A FreeRTOS task should wake up on each event, print a running count, and go back to sleep. The ISR must not do any heavy work; it just signals the task.
Wire up EXTI0 for rising-edge interrupts on PA0 and use a counting semaphore to pass events from the ISR to the processing task. The task prints "EVENT:<n>" for each event (starting from 1), then prints "DONE" after the last one.
Example with 2 events: EVENT:1 EVENT:2 DONE
The same pattern continues for any number of events: one EVENT line per event in order, then a single DONE.
Available FreeRTOS APIs: xSemaphoreCreateCounting(max_count, initial_count) xSemaphoreTake(sem, timeout) xSemaphoreGiveFromISR(sem, pxHigherPriorityTaskWoken) portYIELD_FROM_ISR(xHigherPriorityTaskWoken) xTaskCreate(function, name, stack_size, param, priority, handle) vTaskStartScheduler() portMAX_DELAY configMINIMAL_STACK_SIZE
EXTI and NVIC must be configured for PA0 rising-edge interrupts. The ISR entry point is EXTI0_IRQHandler (IRQ number 6). Remember to clear the EXTI pending bit in the handler.
The simulation runs for 500 ms of virtual time, and all required output must appear within that window.