From 6ec73995e5f6cc49a20233618238bc0621f46f31 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Mar 2025 09:49:34 -0600 Subject: [PATCH 1/3] samples/tests: Ensure test/sample names are unique Ensure that all tests and samples start with 'sample.rust' or 'test.rust' to avoid conflict with names in the main Zephyr tree. Signed-off-by: David Brown --- samples/blinky/sample.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/blinky/sample.yaml b/samples/blinky/sample.yaml index 4878452..410356a 100644 --- a/samples/blinky/sample.yaml +++ b/samples/blinky/sample.yaml @@ -10,7 +10,7 @@ common: - qemu_riscv64 - nrf52840dk/nrf52840 tests: - sample.basic.blinky: + sample.rust.basic.blinky: tags: - LED - gpio From d4f9036a88e53080bf2b186afa5289f9c77a0f73 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Mar 2025 09:50:33 -0600 Subject: [PATCH 2/3] samples: blinky: Remove incorrect integration platform Remove the integration platform, which was with a platform not listed in the supported platforms. Signed-off-by: David Brown --- samples/blinky/sample.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/samples/blinky/sample.yaml b/samples/blinky/sample.yaml index 410356a..169fa5e 100644 --- a/samples/blinky/sample.yaml +++ b/samples/blinky/sample.yaml @@ -17,5 +17,3 @@ tests: filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds") depends_on: gpio harness: led - integration_platforms: - - frdm_k64f From 5fc831d1e5ab0008b0390f90c0628a00680a6b1b Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 11 Apr 2025 09:07:57 +0200 Subject: [PATCH 3/3] work: WorkQueueBuilder: update to include work_timeout_ms member. The k_work_q has been extended with a new feature, the work timeout, which comes with a new field to k_work_queue_config, work_timeout_ms, which must be initialized. Signed-off-by: Bjarki Arge Andreasen --- zephyr/src/work.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zephyr/src/work.rs b/zephyr/src/work.rs index 17e28e0..9e390a2 100644 --- a/zephyr/src/work.rs +++ b/zephyr/src/work.rs @@ -138,6 +138,7 @@ //! .set_priority(2). //! .set_name(c"mainloop") //! .set_no_yield(true) +//! .set_work_timeout_ms(1000) //! .start(MAIN_LOOP_STACK.init_once(()).unwrap()) //! ); //! @@ -220,6 +221,7 @@ impl WorkQueueBuilder { name: ptr::null(), no_yield: false, essential: false, + work_timeout_ms: 0, }, priority: 0, } @@ -255,6 +257,18 @@ impl WorkQueueBuilder { self } + /// Controls whether work queue monitors work timeouts. + /// + /// If non-zero, and CONFIG_WORKQUEUE_WORK_TIMEOUT is enabled, + /// the work queue will monitor the duration of each work item. + /// If the work item handler takes longer than the specified + /// time to execute, the work queue thread will be aborted, and + /// an error will be logged if CONFIG_LOG is enabled. + pub fn set_work_timeout_ms(&mut self, value: u32) -> &mut Self { + self.config.work_timeout_ms = value; + self + } + /// Set the priority for the worker thread. /// /// See the Zephyr docs for the meaning of priority.