ThanhNguyen-Tien/ed-fsm-library ? reverse-engineered prompt
Reverse engineered prompt
Build me a small embedded C library for microcontrollers that follows an event driven design and a finite state machine style. I want the system to have one main engine loop that pulls work from a queue, while interrupts and other parts of the app only post events and never run application logic directly.
It should support simple events, small events with a tiny payload, and larger events that use a fixed memory pool instead of heap allocation. Please include a basic state machine setup with enter and exit handling and optional timeouts, plus a simple timer system for one shot and periodic callbacks. I also want a lightweight signal or observer feature so one part of the app can notify one or many listeners.
Keep it deterministic, safe for ISR use, and easy to debug. If anything is unclear, look up current docs online if you need to, but stay focused on a clean, lightweight embedded implementation.
Are you gonna build this?
make sure you review the code using coderabbit