Skip to content

feat: Add assert for debug builds that won't affect release stability#127

Merged
ETSells merged 5 commits into
mainfrom
ES/debug-assert
May 23, 2026
Merged

feat: Add assert for debug builds that won't affect release stability#127
ETSells merged 5 commits into
mainfrom
ES/debug-assert

Conversation

@ETSells

@ETSells ETSells commented May 23, 2026

Copy link
Copy Markdown
Member

Description

Simple change to add a macro that asserts a condition on debug builds only to check assumptions. Does nothing on release builds to avoid halting execution in flight critical code. Enables better defensive programming practices.

Future idea (for rev 3) will be to send a message over the debug interface when this is hit and then continue execution.

Issue Link

No issue -- just an idea I had while reading through SunDevilRocketry/driver#28.

Testing

  • Passes existing unit tests
  • Unit tests modified (link the test changes as a child PR)
  • Integration test performed

New tests in: SunDevilRocketry/Flight-Computer-Firmware#261

Other

N/A

Reviewer Checklist

Standards

  • Follows FCF Architectural Standards
  • Follows SDR Coding Standards
  • Code complexity/function Size is minimized
  • Code is testable
  • Code is readable and commented properly
  • License terms are respected

Error Handling

  • Potentially unsafe functions return a status code
  • Error returns properly handled

Memory

  • Stack allocated memory is scoped correctly
  • Heap allocated memory is avoided
  • Globally allocated memory is minimized except when necessary
  • Pointers are used correctly
  • Concurrency has been considered

Performance

  • Rate limiters are respected
  • Busy waiting is avoided
  • "Delay" calls are not used in performance sensitive code

@ETSells ETSells requested a review from NArmistead May 23, 2026 19:55

@NArmistead NArmistead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had actually been thinking about doing something like this too

@ETSells

ETSells commented May 23, 2026

Copy link
Copy Markdown
Member Author

Ok sweet!

@ETSells ETSells merged commit 1e904bb into main May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants