nuttx-apps/system/nxinit
wangjianyu3 3328bbb0be system/nxinit: fix on-event actions re-running on every trigger
The `on <event>` action re-executed on every property poll because the
event pending flag was sticky: event_callback returned the same non-zero
pending value whether the event had just changed or had stayed satisfied
from an earlier change. init_action_foreach_event could not distinguish
an edge from a steady state and re-enqueued the action each round
(board_netinit ran 262 times per boot).

Introduce a three-state result (EVENT_STATE_UNSATISFIED / SATISFIED /
TRIGGERED). event_callback now returns TRIGGERED only on the edge where
pending flips false -> true. foreach folds per-event states into a
product clamped to TRIGGERED, enqueuing the action only when every event
is satisfied AND at least one fired this round.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-15 18:51:45 +08:00
..
action.c system/nxinit: fix on-event actions re-running on every trigger 2026-08-15 18:51:45 +08:00
action.h system/nxinit: fix on-event actions re-running on every trigger 2026-08-15 18:51:45 +08:00
builtin.c system/nxinit: Add setprop support for action 2026-08-15 18:51:45 +08:00
builtin.h system/nxinit: Add NuttX Init 2026-05-27 17:20:07 -03:00
CMakeLists.txt system/nxinit: Add setprop support for action 2026-08-15 18:51:45 +08:00
import.c system/nxinit: Fix missing check for import argument 2026-06-05 09:43:45 +08:00
import.h system/nxinit: Add NuttX Init 2026-05-27 17:20:07 -03:00
init.c system/nxinit: Add support for action triggers 2026-08-15 18:51:45 +08:00
init.h system/nxinit: Add setprop support for action 2026-08-15 18:51:45 +08:00
Kconfig system/nxinit: Add support for action triggers 2026-08-15 18:51:45 +08:00
Make.defs system/nxinit: Add NuttX Init 2026-05-27 17:20:07 -03:00
Makefile system/nxinit: Add setprop support for action 2026-08-15 18:51:45 +08:00
parser.c system/nxinit: fix init parser to handle multiple quoted arguments 2026-06-05 09:43:45 +08:00
parser.h system/nxinit: Add NuttX Init 2026-05-27 17:20:07 -03:00
property.h system/nxinit: Add setprop support for action 2026-08-15 18:51:45 +08:00
property_simple.c system/nxinit: Add setprop support for action 2026-08-15 18:51:45 +08:00
service.c system: nxinit: bound debug argv dump 2026-07-07 09:47:23 +08:00
service.h system/nxinit: Let use a define to define the class max cmds 2026-05-27 17:20:07 -03:00