# Front Box Program Structure
###### tags: `firmware_hardware` `electrical_system` `NTURT`
## Tasks
Listed in decending task priority:
1. Error handling
- Handles and reports various errors from other tasks.
- Peripheral:
- Error indicator (gpio)
- Warn indicator (gpio)
- Possible error:
2. State control
- Control RTD and check if the vechile is in valid state.
- Peripheral:
- Possible error:
3. Torque control
- Command the inverter torque output and apps/brake pedal plausibility check.
- Peripheral:
- Possible error:
4. Can signal transceive
- Transceive can signal.
- Peripheral:
- CAN bus (fdcan)
- CAN indicator (gpio)
- Possible error:
5. Dashboard control
- Control the buttons and indicator lights of the dashboard.
- Peripheral:
- Button (gpio)
- Indicator light (gpio)
- Possible error:
6. Sensor data collection
- Collect various sensor data of the front axel.
- Peripheral:
- Tire temperature (i2c)
- Wheel speed (gpio)
- Suspension travel (dac)
- Brake pressure (dac)
- Steer angle (spi)
- Possible error:
## Error handling