-
Notifications
You must be signed in to change notification settings - Fork 669
system/smf: Port SMF .c/.h files to NuttX #3296
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
Conversation
linguini1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really solid! Just some minor comments to pass the CI checks/adhere to the formatting rules. Thank you for porting this to NuttX!
By the way, the commit message's topic and the PR title should be formatted like: system/smf: Port SMF .c/.h files to NuttX
0c1804d to
33f79f2
Compare
33f79f2 to
7a0fad8
Compare
|
Hello All, I solved the issues as requested. Thanks for the review. |
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @FelipeMdeO very useful features! :-)
Just please update select to depends on in the Kconfig as requsted by @xiaoxiang781216 :-)
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, sorry still some build errors + Kconfig updates todo :-)
7a0fad8 to
4f33113
Compare
|
Very cool, thanks @FelipeMdeO, lets just wait for the CI build verificaion :-) |
4f33113 to
1f1cd96
Compare
This commit add state machine framework lib to the NuttX project. Also an example is added to help users understand and use this feature. Changes: Added some files. No impact in other features are expected. Adjust SMF macro names Fix issues requested during MR review update kconfig fix ci-cd issue Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
1f1cd96 to
2172562
Compare
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @FelipeMdeO :-) Lets just wait for the CI to complete :-)
Fixed build issues
Added example to demonstate state machine framework
Removed unused file
Improve code quality | Fix thread termination issue
Note: Please adhere to Contributing Guidelines.
Summary
This change adds the State Machine Framework (SMF) to nuttx-apps as a
self-contained, reusable library.
The SMF provides a deterministic framework for implementing flat and
hierarchical state machines, based on explicit entry, run, and exit actions.
Event handling and scheduling remain fully under application control.
The implementation is a port of the SMF originally introduced in the Zephyr
RTOS, adapted to NuttX coding conventions and build infrastructure. The library
does not perform dynamic memory allocation and is intended to be used with
statically defined state tables.
An example application is included to demonstrate correct usage.
Impact
Testing
The change was validated using the provided SMF hierarchical state machine
(HSM) example application. Example available in:
| Prompt: State Machine Framework PSICC2 demo (HSM) │
│ Location:
│
│ -> Application Configuration │
│ -> Examples
| -> State Machine Framework PSICC2 demo
Testing was performed by enabling the SMF configuration options and building
the example for the simulator target. The example demonstrates:
The example was built and executed using the sim:nsh configuration. Runtime
output was manually verified to confirm correct state transitions and expected
execution order.
No regressions were observed, and existing applications build and run
unchanged when SMF is not enabled.