You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, our fault handler is hard-coded to handle each fault and therefore must be edited each time we add a new exception. Additionally, we use a bitmap to hold different faults which limits the amount of exceptions we can handle. We'd like to update fault state to make it more modular and scalable.
Goal 🏃
To improve changeability, we want to edit Fault State to handle general cases based on priority instead of using the previously implemented, hard-coded handlers and bitmap that are specific to each case. To do this, we'll replace our various assertion functions with a generic assertion that takes in an exception struct containing (1) the priority, (2) a description of the fault, and (3) a function pointer to address any exception-specific behaviors.
Task ☑️
The objective is to revise fault state and its assertion functions for both OS and non-OS faults.
For non-OS faults, we'll need the following:
An exception struct that contains
a priority level int
a description string saying what the exception was (ex. "Read Car can faulted out")
a function pointer with more specific/custom exception handling.
An updated fault state that handles exceptions based on priority level instead of exception type
A generic assertion function that takes an exception struct as a parameter and signals fault state to handle the error
For OS faults, we'll need to create an assertion that does not depend on any OS functionality.
This assertion will
use BSP-layer calls to pull contactors
Enter an infinite while loop
Hit a hard fault inside the while loop
Notes 🗒️
We can be creative about what other fault behaviors might be. Additional features may include using the display and brake lights for telemetry purposes.
Fault state will remain the highest priority task in the system
When an exception happens, the immediate next thing that should happen is the fault state handling
For OS faults, we can borrow from the assertOS function
The text was updated successfully, but these errors were encountered:
Context 🔖
Currently, our fault handler is hard-coded to handle each fault and therefore must be edited each time we add a new exception. Additionally, we use a bitmap to hold different faults which limits the amount of exceptions we can handle. We'd like to update fault state to make it more modular and scalable.
Goal 🏃
To improve changeability, we want to edit Fault State to handle general cases based on priority instead of using the previously implemented, hard-coded handlers and bitmap that are specific to each case. To do this, we'll replace our various assertion functions with a generic assertion that takes in an exception struct containing (1) the priority, (2) a description of the fault, and (3) a function pointer to address any exception-specific behaviors.
Task ☑️
The objective is to revise fault state and its assertion functions for both OS and non-OS faults.
For non-OS faults, we'll need the following:
For OS faults, we'll need to create an assertion that does not depend on any OS functionality.
This assertion will
Notes 🗒️
The text was updated successfully, but these errors were encountered: