Skip to content

Commit 130840c

Browse files
jaz1-nordicrlubos
authored andcommitted
[nrf fromlist] samples: mbox: Align to NO MULTITHREADING
Removed k_sleep dependencies in non-multithreaded runs. Signed-off-by: Jakub Zymelka <[email protected]> Upstream PR: zephyrproject-rtos/zephyr#73857
1 parent b9de465 commit 130840c

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

samples/drivers/mbox/remote/src/main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,20 @@ int main(void)
5151
printk("Maximum TX channels: %d\n", mbox_max_channels_get_dt(&tx_channel));
5252

5353
while (1) {
54+
#if defined(CONFIG_MULTITHREADING)
55+
k_sleep(K_MSEC(3000));
56+
#else
57+
k_busy_wait(3000000);
58+
#endif
59+
5460
printk("Ping (on channel %d)\n", tx_channel.channel_id);
5561

5662
ret = mbox_send_dt(&tx_channel, NULL);
5763
if (ret < 0) {
5864
printk("Could not send (%d)\n", ret);
5965
return 0;
6066
}
61-
62-
k_sleep(K_MSEC(3000));
6367
}
6468
#endif /* CONFIG_TX_ENABLED */
65-
6669
return 0;
6770
}

samples/drivers/mbox/sample.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,38 @@ tests:
8282
regex:
8383
- "Ping \\(on channel 16\\)"
8484
- "Pong \\(on channel 15\\)"
85+
86+
sample.drivers.mbox.nrf54l15_no_multithreading:
87+
platform_allow:
88+
- nrf54l15pdk/nrf54l15/cpuapp
89+
integration_platforms:
90+
- nrf54l15pdk/nrf54l15/cpuapp
91+
extra_args:
92+
mbox_SNIPPET=nordic-flpr
93+
mbox_CONFIG_MULTITHREADING=n
94+
remote_CONFIG_MULTITHREADING=n
95+
sysbuild: true
96+
harness: console
97+
harness_config:
98+
type: multi_line
99+
ordered: false
100+
regex:
101+
- "Ping \\(on channel 16\\)"
102+
- "Pong \\(on channel 15\\)"
103+
104+
sample.drivers.mbox.nrf54l15_remote_no_multithreading:
105+
platform_allow:
106+
- nrf54l15pdk/nrf54l15/cpuapp
107+
integration_platforms:
108+
- nrf54l15pdk/nrf54l15/cpuapp
109+
extra_args:
110+
mbox_SNIPPET=nordic-flpr
111+
remote_CONFIG_MULTITHREADING=n
112+
sysbuild: true
113+
harness: console
114+
harness_config:
115+
type: multi_line
116+
ordered: false
117+
regex:
118+
- "Ping \\(on channel 16\\)"
119+
- "Pong \\(on channel 15\\)"

samples/drivers/mbox/src/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ int main(void)
4747
printk("Maximum TX channels: %d\n", mbox_max_channels_get_dt(&tx_channel));
4848

4949
while (1) {
50+
#if defined(CONFIG_MULTITHREADING)
5051
k_sleep(K_MSEC(2000));
52+
#else
53+
k_busy_wait(2000000);
54+
#endif
5155

5256
printk("Ping (on channel %d)\n", tx_channel.channel_id);
5357

0 commit comments

Comments
 (0)