> For the complete documentation index, see [llms.txt](https://moretorques-organization.gitbook.io/torque-interceptor-2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://moretorques-organization.gitbook.io/torque-interceptor-2/achieving-functional-safety/states.md).

# States

If an error occurs and is detected by the MCU, it will set a violation to report the error and it may also change to the ERROR or CRITICAL\_ERROR state depending on the severity. This information is transmitted over the CAN Bus.

* OFF: Default power-up state&#x20;
* INIT:  Initialization
* STANDBY:  Waiting for torque sensor signal
* DRIVE: Normal Operation
* ERROR: Bypass operation
* CRITICAL\_ERROR:  Silent Operation

  <br>

When the MCU exits the bootloader, the MCU is in the OFF state. When the main loop starts it enters the INIT state. This happens before the initialization of the peripherals and interrupts.  After successful initialization, the MCU will then enter STANDBY. When the MCU receives a valid message from the torque sensor it will enter the DRIVE state.

OFF -> INIT -> STANDBY -> DRIVE

All states can be overridden by the CRITICAL\_ERROR state.

All states except CRITICAL\_ERROR can be overridden by ERROR state

STANDBY state can be overridden by a DRIVE state.

INIT state can be overridden by the STANDBY state.

OFF state can be overridden by the INIT state.

<br>
