This project is a fork of a library from Zephyr project which is great to use as a standalone library for making state machines easier and cleaner.
The smf
library has one of the cleanest interface and it is quite easy to use.
This repository provides an integration for the CMake build system that allows to add the smf
library
to your project without a headache.
There are two options available:
SMF_ANCESTOR_SUPPORT
enables/disables hierarchical state machine supportSMF_CONFIG_FILE
a configuration filename that will be included intosmf
Configuration file may provide the following stuff that smf
would use:
#ifndef MY_SMF_CONFIG_H
#define MY_SMF_CONFIG_H
// enable hierarchical state machine feature
#define CONFIG_SMF_ANCESTOR_SUPPORT
// ...
// Logging macro that smf library uses
#define LOG_WARN(...)
#endif /* MY_SMF_CONFIG_H */
Flat state machine example:
Hierarchical state machine example (CONFIG_SMF_ANCESTOR_SUPPORT
enabled):
You may find the full-featured documentation on Zephyr project page
Contributions are always welcome! If you have an idea, it's best to float it by me before working on it to ensure no effort is wasted. If there's already an open issue for it, knock yourself out. See the contributing section for additional details
This project is licensed under:
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in time by you, as defined in the Apache-2.0, shall be licensed as above, without any additional terms or conditions.