Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 2.65 KB

masterboard_state_machine.md

File metadata and controls

27 lines (20 loc) · 2.65 KB

Master Board State Machine

The master board runs a state machine that handles the differents stages of communication and errors that can occur.

State machine description and behaviour

master board state machine diagram

Diagram generated using Mermaid Live Editor, click on picture to edit.

During WAITING_FOR_INIT, the master board waits for an init message from both ethernet and wifi, checking all channels. This enables an autoselection of the type of communication with the computer.

Please note that WIFI_ETH_LINK_DOWN state is accessible from any state except WAITING_FOR_INIT via a callback on the ethernet link down event, but links have not been drawn for the sake of readability.

State machine LED code

To each state is associated a LED behaviour.

State LED behaviour
SETUP Steady White
WAITING_FOR_INIT Red Fade
SPI_AUTODETECT Magenta Fade
SENDING_INIT_ACK Blue Fade
ACTIVE_CONTROL Green Fade
WIFI_ETH_LINK_DOWN Yellow Blink
WIFI_ETH_ETH_ERROR Red Blink