Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Fault State #311

Closed
KnockbackNemo opened this issue Apr 8, 2023 · 0 comments · Fixed by #312
Closed

Update Fault State #311

KnockbackNemo opened this issue Apr 8, 2023 · 0 comments · Fixed by #312
Assignees
Labels
Application Application Layer Issue enhancement New feature or request M2

Comments

@KnockbackNemo
Copy link
Contributor

KnockbackNemo commented Apr 8, 2023

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:

  • 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
@KnockbackNemo KnockbackNemo added enhancement New feature or request Application Application Layer Issue labels Apr 8, 2023
@KnockbackNemo KnockbackNemo linked a pull request Apr 8, 2023 that will close this issue
@IshDeshpa IshDeshpa added the M2 label May 31, 2023
@IshDeshpa IshDeshpa moved this to In Progress in Controls M2.0 Release Jun 6, 2023
@IshDeshpa IshDeshpa moved this from In Progress to Testing in Controls M2.0 Release Jun 19, 2023
@IshDeshpa IshDeshpa moved this from Testing to In Progress in Controls M2.0 Release Jun 26, 2023
@IshDeshpa IshDeshpa moved this from In Progress to Ready to Review in Controls M2.0 Release Jul 25, 2023
@IshDeshpa IshDeshpa moved this from Ready to Review to Testing in Controls M2.0 Release Sep 3, 2023
@github-project-automation github-project-automation bot moved this from Testing to Done in Controls M2.0 Release Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Application Application Layer Issue enhancement New feature or request M2
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants