When building with clang and -Wno-gnu it complains about the missing
equals:
tests/lib/smf/src/test_lib_hierarchical_5_ancestor_smf.c:415:8: error:
use of GNU 'missing =' extension in designator
[-Werror,-Wgnu-designator]
[P05] SMF_CREATE_STATE(p05_entry, p05_run, p05_exit, NULL, NULL),
^
=
tests/lib/smf/src/test_lib_hierarchical_5_ancestor_smf.c:416:8: error:
use of GNU 'missing =' extension in designator
[-Werror,-Wgnu-designator]
[P04] SMF_CREATE_STATE(p04_entry, p04_run, p04_exit, &test_states[P05],
^ NULL),
=
tests/lib/smf/src/test_lib_hierarchical_5_ancestor_smf.c:417:8: error:
use of GNU 'missing =' extension in designator
[-Werror,-Wgnu-designator]
[P03] SMF_CREATE_STATE(p03_entry, p03_run, p03_exit, &test_states[P04],
^ NULL),
=
tests/lib/smf/src/test_lib_hierarchical_5_ancestor_smf.c:418:8: error:
use of GNU 'missing =' extension in designator
[-Werror,-Wgnu-designator]
[P02] SMF_CREATE_STATE(p02_entry, p02_run, p02_exit, &test_states[P03],
^ NULL),
=
tests/lib/smf/src/test_lib_hierarchical_5_ancestor_smf.c:419:8: error:
use of GNU 'missing =' extension in designator
[-Werror,-Wgnu-designator]
[P01] SMF_CREATE_STATE(p01_entry, p01_run, p01_exit, &test_states[P02],
^ NULL),
=
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Update test_lib_self_transition_smf.c to detect the bug that was in
smf_set_handled().
Also delete unneeded test state STATE_D_ENTRY
Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
Modify the SMF such that state transitions from parent states choose the
correct Least Common Ancestor based on the transition source rather than
the current state.
SMF set as experimental.
Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
This sets the number of arguments for SMF_CREATE_STATE() to always
be the same, independent of the selected Kconfig options.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Brings SMF framework closer into alignment with accepted Hierarchical State
Machine operation by:
1. Allowing 'programming by difference' by having some child states handle
events and prevent propagation up to the parent run actions while others
propagate events up to a common handler in a parent state.
2. Optionally allow initial transitions within a parent state to determine
the most nested child state to transition to.
3. Adding a test case for `CONFIG_SMF_INITIAL_TRANSITION` and
`smf_set_handled()`
4. Updating documentation for the new API (and fixing some references)
There was discussion in https://github.com/zephyrproject-rtos/zephyr/issues/55344
about not making the initial transition a Kconfig option, but I'm not sure
of any way else of doing it without permanently adding a pointer to each
`smf_state` entry, which is a problem for resource-constrained devices.
This does not fix https://github.com/zephyrproject-rtos/zephyr/issues/66341
but documentation has been updated to warn users of the issue.
Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
As Zephyr currently requires CMake version 3.20.0, update all
occurrences of cmake_minimum_required.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add an application agnostic State Machine Framework library to
Zephyr that provides an easy way for developers to integrate
state machines into their application.
Twister passed:
twister -T tests/lib/smf/
Signed-off-by: Sam Hurst <sbh1187@gmail.com>