Northeastern-Electric-Racing / Northeastern-Electric-Racing/firmware-rs

Add Fault Management Utility

Open
#20 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
0
Forks
2
Avg merge
2d 17h
Merged PRs (30d)
5

Description

Fault management machine.

Requirements:

  • Allows registration of fault types either at compile time or construction. I would assume an enum of structs that are static in memory and const in construction. Faults contain pretty-name, some sort of ID, severity, and clear-time.
  • Handles faults of two or three levels of severity: Critical (will fault the car), Non-critical (will not fault the car), and advisory (will not impact anything).
  • Implements configurable time delay on when to clear a fault after it is last triggered, could be per-fault or global.
  • Has a method of extracting data necessary to send a CAN message.
  • Has a method of triggering a fault and quering what faults are triggered and what level the overall car is in (critical fault, non-critical fault, or advisory, or none) (this is just the highest severity).
  • Has a way to log all faults on rising and clearing edge via RTT warn!.

Ideas:
Faults can be simply metadata attached to the enum of const faults. When the fault occurs you can mutate the metdata. The challenging part is the ergonomics of using the library across multiple threads. A mutex may be in hand, a ThreadModeMutex could allow you to have a global static you can access anywhere very ergonomically.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by mapping the repository’s existing CAN, RTT, and threading entry points, then compare their APIs with the listed requirements. Done means the utility covers fault registration, severity, clearing delays, CAN extraction, querying, and rising/clearing-edge logging.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.