Whenever you're ready, walk me through how you'd approach this.
Describe how you implement a state machine in C for embedded systems, and how you use an RTOS when applicable.