@startuml scale max 900*520 skinparam backgroundColor transparent skinparam shadowing false skinparam defaultFontName "DejaVu Sans Mono" skinparam defaultFontSize 13 skinparam stateBorderColor #2b6f8e skinparam stateBackgroundColor #edf6fa skinparam ArrowColor #8295a0 top to bottom direction title A6 STATE — binary semaphore and task readiness across ISR state "01 EMPTY\nwaiter Blocked" as Empty state "02 IRQ PENDING\nstimulus interrupted" as Pending state "03 GIVEN FROM ISR\nwaiter Ready" as Given state "04 SWITCH REQUESTED\nxHPW=true" as Switch state "05 TAKEN\nwaiter Running" as Taken state "06 STIMULUS RESUMED" as Resumed [*] --> Empty Empty --> Pending : SET_IRQ Pending --> Given : GiveFromISR Given --> Switch : portYIELD_FROM_ISR Switch --> Taken : restore waiter context Taken --> Resumed : waiter completes Resumed --> [*] @enduml