Skip to content

v1.2.0: PlatformIO example and CI; FaultHandler weak and halting - #6

Merged
endurodave merged 1 commit into
masterfrom
feature/platformio-example
Nov 15, 2026
Merged

endurodave merged 1 commit into
masterfrom
feature/platformio-example

Conversation

@endurodave

Copy link
Copy Markdown
Owner

Summary

  • Example: examples/platformio/statemachine-demo drives the Motor state machine through its states and then sends 1000 events, checking that every event's data is deleted. Boards: ESP32, ESP32-C3, Nucleo-F401RE, STM32F4 Discovery, Pico, native.
  • CI: PlatformIO workflow builds every board and runs native.
  • FaultHandler: weak on GCC/Clang so an application or another library (C_Allocator, SimpleSocketProtocol) can provide its own; calls abort() after assert(0) instead of while(1) (which hung desktop/CI builds). DebugBreak() only with a debugger attached.
  • README: owner-qualified lib_deps = endurodave/StateMachine@^1.2.0 (StateMachine alone is ambiguous in the registry), the example, FaultHandler, PlatformIO badge. .gitignore: .pio/.

Found in a code review of the PlatformIO libraries.

Testing

  • STM32F4 Discovery: demo PASSED (state sequence and 1000 events).
  • ESP32, ESP32-C3, Nucleo, Pico build; Windows CMake desktop app builds and runs.

🤖 Generated with Claude Code

- examples/platformio/statemachine-demo: Motor state machine through its
  states plus 1000 events (event data deleted by the state machine), for
  ESP32, ESP32-C3, Nucleo-F401RE, STM32F4 Discovery, Pico and native.
- PlatformIO CI workflow builds every board and runs native.
- Fault.cpp: FaultHandler is weak on GCC/Clang (an application or another
  library can provide its own) and calls abort() after assert. It used to end
  in while(1), which hung desktop builds, and returned nothing useful under
  NDEBUG. DebugBreak() only with a debugger attached.
- README: owner-qualified lib_deps (endurodave/StateMachine), example,
  FaultHandler, PlatformIO badge. .gitignore: .pio/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@endurodave
endurodave merged commit 5edb120 into master Nov 15, 2026
9 checks passed
@endurodave
endurodave deleted the feature/platformio-example branch November 15, 2026 17:20
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.

1 participant