Commit graph

9250 commits

Author SHA1 Message Date
raiden00pl
d570175cc9 interpreters/python: use NuttX readline for TTY input
CPython's default TTY reader bypasses NuttX editing and control-key handling.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-24 22:15:31 +08:00
raiden00pl
9545e12054 system/readline: add caller-selectable control handling
Let CPython handle Ctrl-D and signals without changing existing NSH behavior.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-24 22:15:31 +08:00
wangjianyu3
0923948d80 system/nxinit: fix event-board timing
Move the boot event orchestration into a preset config buffer so the
"init" and (optional) "netinit"/"finalinit" events are triggered as a
serialized chain rather than queued back-to-back in main(). This fixes
the timing between preset event initialization and board initialization.

Adapted for the community tree: BOARDIOC_INIT has been removed upstream
(replaced by CONFIG_BOARD_LATE_INITIALIZE), so no board_init/board_finalinit
builtins are added and no boardctl(BOARDIOC_INIT)/boardctl(BOARDIOC_FINALINIT)
calls are reintroduced; board device init is now performed by the kernel
before init starts.

netinit is not a boardctl call, so it is kept in the serialized event
chain like the original: add a "netinit" builtin that calls
netinit_bringup(), driven by "on init -> trigger netinit -> on netinit",
instead of calling netinit_bringup() directly in main(). finalinit
remains a pure event for user-defined services to hook.

Assisted-by: GitHubCopilot:claude-opus-4.8
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-24 20:11:14 +08:00
jingfei
6d178011d5 system/nxinit: Add start_cpu support for action
Add support for starting a cpu's software.
Depends on `BOARDCTL_START_CPU`.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-08-24 20:11:14 +08:00
wangjianyu3
a485d9636b system/nxinit: Add boot support for action
Add support for booting a new application firmware image.
Depends on `BOARDCTL_BOOT_IMAGE`.

When the built-in boot command of nsh is enabled, the built-in boot
command of Init will take precedence (see init_builtin_run()). To use
the built-in boot command of nsh, use: `exec -- sh boot [args...]`.

Referred to nshlib/nsh_syscmds.c: cmd_boot()

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-24 20:11:14 +08:00
wangjianyu3
e0a1031bcc system/nxinit: add check loop to init_parse_config_buffer
Add the parser[n].check validation loop to init_parse_config_buffer(),
matching the same pattern already used in init_parse_config_file().
This ensures that services and actions parsed from in-memory buffers
are properly validated after parsing.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-24 20:11:14 +08:00
wangjianyu3
63eb6c79f2 system/nxinit: Extract init_parse_config_buffer()
Extract the init_parse_config_buffer() interface from the init_parse_config_file() function.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-24 20:11:14 +08:00
zhangyu117
21bb388f8e apps: replace atomic_fetch_xxx with atomic_xxx
Rename atomic_fetch_xxx to atomic_xxx (e.g., atomic_fetch_add ->
atomic_add) and atomic_store/atomic_load to atomic_set/atomic_read,
to match the <nuttx/atomic.h> API rename in the companion nuttx PR.

The atomic_fetch_xxx naming is reserved by the C/C++ standard and
conflicts with standard library declarations when <atomic>/
<stdatomic.h> is included by third-party code.

Files changed:
- crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c
- testing/libc/atomic/atomic_main.c
- testing/ostest/roundrobin.c
- testing/ostest/spinlock.c

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-08-24 20:10:37 +08:00
aviralgarg05
44d1f6c05a examples/calculator: add an LVGL touchscreen calculator
Add a touchscreen calculator with cooperative shutdown and board initialization through BOARDIOC_FINALINIT.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-24 12:03:42 +08:00
aviralgarg05
e871059fa4 games: support supervised loadable game processes
Allow cgol, match4, and snake to build as modules. Let cgol handle SIGTERM from its render loop and release the framebuffer.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-24 12:02:46 +08:00
Bogdan
31342e02ce testing/nettest: add cmocka test for local socket SCM_RIGHTS
Add CMocka regression test case to verify local socket SCM_RIGHTS
behavior when the file descriptor table is exhausted.

Signed-off-by: Bogdan <Bogdan4ik0759@gmail.com>
2026-08-23 11:04:33 +08:00
raiden00pl
a71c329cfb netutils/paho_mqtt: configure embedded runtime mode
Expose the upstream HIGH_PERFORMANCE mode through
CONFIG_LIB_MQTT5_HIGH_PERFORMANCE and enable it by default. This keeps
normal embedded builds lightweight while allowing developers to restore
Paho heap and call-stack diagnostics when investigating library issues.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: OpenAI Codex:gpt-5
2026-08-22 17:10:33 -03:00
raiden00pl
53c234880c netutils/paho_mqtt: separate library worker stack size
Add CONFIG_LIB_MQTT5_THREAD_STACKSIZE for threads created
internally by Paho and use it in Thread.c.
Keep CONFIG_UTILS_MQTT5_STACKSIZE scoped to the two utility
application tasks.

This permits S2OPC to enable MQTT through LIB_MQTT5 without
also building unrelated command-line utilities.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: OpenAI Codex:gpt-5
2026-08-22 17:10:33 -03:00
raiden00pl
6e56388956 netutils/paho_mqtt: fix package preparation and utilities
The bundled patch still contains an MQTTPacket.h hunk for a bool
typedef that no longer exists in Paho 1.3.15. Make and CMake both
hide the resulting rejection, allowing a partially patched source
tree to be compiled. Remove the stale hunk and make patch failures
fatal.

The Make context target also allows VersionInfo.h generation to
race source extraction under parallel builds. Make the generated
header depend on the extraction target so the input template is
present first.

The publisher and subscriber samples live below src/samples but
include public headers from src. Add the Paho source include directory
to the Make flags, matching the CMake targets, so CONFIG_UTILS_MQTT5
builds both utilities.

Finally, define distclean independently of whether the downloaded
tree exists when Make parses the file. Remove package-owned archives
and sources while preserving a developer Git checkout, and ignore
those downloaded paths.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: OpenAI Codex:gpt-5
2026-08-22 17:10:33 -03:00
raiden00pl
e3dc165ccc examples/nxterm: add serial console fallback
Prevent framebuffer startup failures from leaving the system without NSH.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-22 17:09:58 -03:00
raiden00pl
c775800214 examples/nxterm: add PTY-backed keyboard console
Convert event-mode keyboard records into the TTY input and signals NSH expects.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-22 17:09:58 -03:00
raiden00pl
6b3b42008b examples/nxterm: add full-screen window option
Use the full framebuffer instead of the example's centered three-quarter window.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-22 08:47:01 -03:00
raiden00pl
96f6e7d460 system/readline: restore terminal attributes safely
Track successful mode changes so failed setup cannot corrupt terminal state.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-22 08:45:03 -03:00
wangjianyu3
247a8c03cb system/nxinit: fix argument parser treating --option as -- separator
The init_parse_arguments() function checked for '--' by only
comparing the first two characters, causing options like --system,
--nofork to be misinterpreted as the '--' argument separator. This
truncated the remaining arguments. Add an isblank() check on the
third character to ensure only standalone '--' followed by whitespace
triggers the separator logic.

Assisted-by: GitHubCopilot:claude-4.6-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-22 17:36:04 +08:00
wangjianyu3
8ff98a6b51 system/nxinit: Parse default cpu-specific configs
On the basis of init.rc, add default parsing of cpu-specific configs.
- /etc/init.d/init.rc
- /etc/init.d/init.cpu${CPUID}.rc

Refactor function `init_parse_configs()` to parse files from the default path
instead of identifying and parsing directories or files, as the functionality
is unnecessary.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-22 17:36:04 +08:00
Acfboy
d7f64eca5b example/microwindows: exports microwindows/src/include
registers microwindows/src/include through the EXPORTED_INCLUDES
 mechanism in its Make.defs

Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-08-21 10:59:06 -03:00
Acfboy
564cabe9b1 build: introduce EXPORTED_INCLUDES machanism
* Introduce EXPORTED_INCLUDES in apps/Make.defs; every entry is
  prefixed with INCDIR_PREFIX and added to CFLAGS/CXXFLAGS so it
  takes effect in the in-tree build as well
* The export target in apps/Makefile copies the content of the listed
  directories into the include directory of the export package, so
  out-of-tree applications built from the package can still find the
  public headers

Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-08-21 10:59:06 -03:00
Acfboy
1080111f99 graphics/microwindows: add NONETWORK mode for linking Nano-X apps with the server
* Add CONFIG_MICROWINDOWS_NANOX_NONETWORK which builds the Nano-X
  client library and server in the linked-in (NONETWORK) mode, so
  client applications are linked directly with the server and run in
  the same task, requiring no network stack or socket at all
* Reorganize the source lists: the drawing sources (nxdraw, nxutil,
  nxtransform, nxpaintnc) are shared by both modes, while the server
  is built from srvnet.c in the network mode and srvnonet.c in the
  NONETWORK mode
* Use MULTITHREAD_SERVER in the network mode so that several client
  tasks can run at the same time in the flat build
* Let the examples/nanoxterm start the server task only in the
  network mode (NONETWORK applications run the server inside main)

Assisted-by: OpenCode:DeepSeek-V4-Flash
Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-08-21 10:59:06 -03:00
Acfboy
634d2dbdea examples/nanoxterm: add Nano-X terminal emulator example
* Port the nxterm demo from Microwindows
* Starts the Nano-X server as a separate task before connecting
* Runs an NSH shell instance on a pseudo terminal in the spwaned child
  instead of exec /bin/sh (no filesystem binaries in flat builds)

Assisted-by: OpenCode:DeepSeek-V4-Flash
Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-08-21 10:59:06 -03:00
Acfboy
d79e503612 examples/nanoxcalc: add Nano-X calculator example
* Port the nxcalc demo from Microwindows
* Connects to the Nano-X server started by examples/nanoxterm
* Requires CONFIG_LIBC_FLOATINGPOINT for the result formatting

Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-08-21 10:59:06 -03:00
Acfboy
edb4d26663 graphics/microwindows: add Nano-X client library and built-in server support for NuttX
Build the Nano-X client library, server and (optional) built-in window manager
from the bundled Microwindows tree

Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-08-21 10:59:06 -03:00
raiden00pl
e21cf5c292 system/expat: add reusable XML parser package
add reusable XML parser package

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: OpenAI Codex:gpt-5
2026-08-21 20:09:58 +08:00
aviralgarg05
c0143f0f46 tools: export package metadata and RGB565 icons
Write optional package metadata and convert icons to bounded RGB565 assets. Reject paths outside the package directory.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-21 08:15:34 -03:00
Abhishek Mishra
0b3d36a1a6 testing: add ostest coverage for chroot
Check jail visibility, host-path isolation, child inheritance, and that
a pre-opened host fd remains usable after chroot().

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-21 02:54:29 +08:00
Abhishek Mishra
f75251f7e3 nshlib: close extra fds before jailed execvp
chroot <newroot> <command> closes non-stdio, non-O_CLOEXEC descriptors
before execvp so inherited host fds cannot bypass the jail.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-21 02:54:29 +08:00
Abhishek Mishra
bcf2cd1795 nshlib: add chroot command
chdir into the new root, call chroot("."), then chdir("/") so relative
paths stay in the jail. With a command, execvp() after the jail is set.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-21 02:54:29 +08:00
aviralgarg05
68aa7a838b games/brickmatch: add touchscreen input and module support
Route touch presses through BrickMatch's input layer and allow the game to build as a module.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-20 09:17:22 -03:00
Justin Hammond
f4d71b6074 testing/libc/arch_libc: Time against a clock that runs.
Every measurement repeats until a stated interval has passed, so a clock
that reads the same value twice does not slow the benchmark down, it stops
it returning at all.

CLOCK_MONOTONIC does not advance on every target.  On qemu-intel64 it
reports success and stays at zero, while CLOCK_REALTIME advances normally,
and the benchmark spins in its first measurement with no output after the
heading.

Sample each candidate twice around a busy wait and take the first one whose
reading changes.  Where none does, say so and skip the timing rather than
hang.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-18 15:27:07 -03:00
Justin Hammond
f45a02c938 testing/libc/arch_libc: Test memccpy and stpncpy.
Neither is covered here, and both are overridable, so a machine or libc
implementation of either goes in unmeasured and unchecked.

memccpy is checked with the search character present, where the copy
stops just past it and the result points there, and absent, where the
whole length is copied and the result is NULL.  stpncpy is checked
against every capacity from zero to four past the length, for the
content, the zero padding beyond the terminator, and the returned
pointer, which is the terminator when the string fits and one past the
end when it does not.

Both sweep all sixty four source and destination alignment pairs, and
both are added to the benchmark, which now covers nineteen functions.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-18 15:27:07 -03:00
Justin Hammond
f4bb54e4d1 testing/libc/arch_libc: Test strlcpy.
strlcpy is the one function in this directory's reach that nothing here
covers, and a machine directory may override it like any other.

Sweep every source and destination alignment pair against sizes 1 to 64,
and for each of those every capacity from zero to one past the length.
Check the return value, which is the length of src whether or not the
copy fit, the truncation point, the content, that a capacity of zero
writes nothing at all, and that nothing lands past the terminator.

The alignment pairs are the point.  An implementation that walks one of
the two pointers to a boundary and then copies a register at a time is
correct whenever the two agree, so a test that only ever passes matching
alignments says nothing about it.

The timing half is guarded.  perf_gettime() is not a system call, so an
application reaches it only where the C library builds its own copy or
where the application and the kernel are one image; calling it
unconditionally leaves the test unbuildable on a kernel build, which is
where the correctness half is still wanted.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-18 15:27:07 -03:00
Justin Hammond
d4fd491f5a testing/libc/arch_libc: Add a throughput benchmark.
The existing speed checks time one call at one size, 128 bytes, with both
operands aligned.  A machine implementation usually takes its wide path
only when the pointers satisfy some alignment condition, so that single
point reports the best case and says nothing about the rest of the input
space.

Measure the same functions across a size sweep and every source and
destination alignment pair instead, plus strlcpy.  On rv64 the difference
this exposes is not marginal:

  strcpy    32768 B  s+0/d+0     2938.0 MB/s
  strcpy    32768 B  s+1/d+1     2942.0 MB/s
  strcpy    32768 B  s+1/d+2      626.0 MB/s
  memcmp    32768 B  s+0/d+0      412.4 MB/s
  memcmp    32768 B  s+1/d+2       41.0 MB/s

Two pointers misaligned by the same amount run at the aligned rate;
misaligned by different amounts they fall to a tenth of it.  Neither
number is visible from an aligned measurement alone.

A function with no machine implementation reports the same rate at every
alignment, so the sweep also shows which of them a machine directory
actually covers.

Each result reports MB/s, which compares across machines, and cycles per
byte where perf_gettime() is reachable from an application, both from one
timed loop.  strcat starts from an empty destination on each turn, since
appending to the last result would grow it without bound, so its figure
includes that store.

It sits behind TESTING_ARCH_LIBC_BENCH, default n, because a measurement
runs for a fixed interval and a full sweep takes about a minute.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-18 15:27:07 -03:00
aviralgarg05
5e057f38b9 build: add declarative shared library support
Add Library.mk for declarative shared-library builds. Reuse the compiler-runtime lookup shared with Application.mk and cover multi-source libraries with sotest.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-18 15:26:18 -03:00
raiden00pl
fa4a430080 interpreters/python: fix build for x86_64 targets built with the host gcc
NuttX x86_64 (qemu-intel64) builds with the native host gcc, which
exposed several host-environment leaks in the CPython cross build:

- Pass the -D/-U macro flags from CFLAGS as CPPFLAGS so
  preprocessor-only configure probes (Misc/platform_triplet.c) do not
  see the host's __linux__ and misdetect the platform as
  x86_64-linux-gnu, enabling Linux-only code such as the perf
  trampoline.

- Force linux/random.h and sys/xattr.h probes to no in config.site:
  NuttX provides neither, but a native toolchain resolves them against
  the host /usr/include.  The former drags host ioctl macros into
  posixmodule, the latter enables os xattr support with no xattr
  syscalls to link against.

- Disable _curses, _curses_panel, _dbm, _gdbm, _hashlib and _tkinter:
  their host libraries are discovered via pkg-config when the target
  compiler can compile host headers.  hashlib keeps working through
  the built-in HACL implementations.

- Only build _posixsubprocess when the arch has a real fork(): its
  vfork() support is only an optimization and the fork() fallback path
  (PyOS_BeforeFork/PyOS_AfterFork_*) is compiled unconditionally but
  declared only under HAVE_FORK.  This also fixes rv-virt:python,
  which became vfork-only after the fork/vfork split.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-18 15:23:54 -03:00
aviralgarg05
0eb44a1085 system/nxstore: add an LVGL app-store front end
Add an LVGL front end for browsing, installing, updating, and launching nxpkg entries. Keep network and install work off the UI path, and stop launched apps with SIGTERM.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-18 15:23:15 -03:00
000exploit
191e244082 graphics/pdcurs34: Fixes for wide char build
Signed-off-by: 000exploit <illialoo99@gmail.com>
2026-08-19 00:49:57 +08:00
zhaoyutao1
a59eb5ce1a nshlib: fix builtin_isavail() index 0 check
builtin_isavail() returns 0-based index on success and negative
errno on failure. The condition 'index > 0' incorrectly rejects
valid index 0, making the first builtin app (index 0) unusable
as an NSH command under CONFIG_NSH_BUILTIN_AS_COMMAND.

Fix by changing to 'index >= 0'.

Signed-off-by: zhaoyutao1 <zhaoyutao1@xiaomi.com>
2026-08-18 19:27:44 +08:00
raiden00pl
cc3c3aa316 ci: do not trigger Build on PR description edits
The Depends-On feature (commit 2aebae740) made the Build workflow
trigger on PR description edits. A gate job checks whether the edit
changed any Depends-On declaration: if yes, the build jobs run again
with the new dependencies; on any other edit the gate skips all build
jobs.

The gate has a side effect that breaks PR check results. Skipped jobs
still register check results on the PR, and the PR checks view shows
the newest check run of each name. So after any description edit the
PR shows "skipped" for every build check instead of the pass/fail
from the real run. Re-running that newest run only repeats the skip,
so the real results never come back. This can also hide a red X from
a failed build.

Fix by not triggering Build on description edits at all: remove the
"edited" event type and the gate job.

Depends-On keeps working: dependencies are read from the description
at the start of every run against master, as before. Fetch-Source now
re-reads the description through the API instead of using the copy
stored in the event payload, so every run uses the current Depends-On
state no matter how it was triggered.

After editing a Depends-On line, retrigger CI by any of:
- pushing new or rebased commits to the PR branch
- closing and reopening the PR
- pressing "Re-run all jobs" on the existing Build run

A description edit alone no longer triggers anything, which is
exactly the behavior that corrupted the PR check results.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-18 10:42:51 +08:00
aviralgarg05
e269d1cbe5 examples/lvgltouch: add touchscreen diagnostics
Add a separate LVGL example that reports touchscreen state, presses, and coordinates without changing lvgldemo.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-17 14:54:55 +02:00
aviralgarg05
2fcb2dfbdd system/nxpkg: complete the package lifecycle
Add the remaining package commands. Order database and payload updates so failures do not leave stale version pointers.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-17 09:20:57 -03:00
aviralgarg05
c4fd2b9b0e system/nxpkg: fetch repositories over HTTP
Download catalogs and artifacts with bounded buffers and atomic staging. Prepare storage before taking the lock so first-run syncs are safe.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-17 09:20:39 -03:00
aviralgarg05
0717e05248 system/nxpkg: validate catalog and database contents
Validate package fields before using them and ensure version pointers refer to installed entries. Keep installed manifests available for rollback.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-17 09:20:22 -03:00
aviralgarg05
d0c15c8c87 system/nxpkg: make package storage crash-safe
Make the nxpkg storage root configurable and write owned files through temporary paths before renaming them. Record lock ownership so processes can recover abandoned locks safely.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-08-17 09:13:41 -03:00
Abhishek Mishra
7358692c59 system/sudo: add setuid privilege helper
Install a UNIX-style setuid-root sudo app: the kernel raises euid on
exec, userspace verifies the caller with passwd_verify(), then
setresuid/setgroups and execvp() run the command.  Ostest covers
setuid exec after a hard credential drop.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-17 09:06:13 -03:00
Alan Carvalho de Assis
84ffa84e24 system/toybox: Add toybox a tool box similar to busybox
Toybox is the toolbox used on Android by default. Adding it to NuttX
allows to have more advanced features from Linux, even better support
for shell scripts.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 22:28:49 +02:00
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