Skip to content

Commit 86eea62

Browse files
committed
samples: sensor: Use dedicated overlay for fake sensor in sensor_shell
Using an app.overlay file is inherently preventing the use of board overlays. Switch to a dedicated overlay file so that e.g. the vmu_rt1170/mimxrt1176/cm7 board target can pass this test where before it would have failed due to its board-specific overlay "winning" over the app.overlay file. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent a2fffdc commit 86eea62

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

samples/sensor/sensor_shell/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
config SAMPLES_SENSOR_SHELL_FAKE_SENSOR
55
bool "Enable fake sensor"
6+
default y
7+
depends on DT_HAS_VND_FAKE_SENSOR_ENABLED
68
help
79
On boards that do not have a sensor, enabling this will build a fake
810
sensor that can be interacted with via the sensor shell.

samples/sensor/sensor_shell/README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ enabled, for example:
1919
:board: reel_board
2020
:goals: build flash
2121

22-
For boards that do not have a sensor, a simple fake sensor driver is provided, for example:
22+
For boards that do not have a sensor, a simple fake sensor driver is provided and can enabled by
23+
adding the following overlay:
2324

2425
.. zephyr-app-commands::
2526
:zephyr-app: samples/sensor/sensor_shell
2627
:board: qemu_riscv64
2728
:goals: run
28-
:gen-args: -DCONFIG_SAMPLES_SENSOR_SHELL_FAKE_SENSOR=y
29+
:gen-args: -DEXTRA_DTC_OVERLAY_FILE=fake_sensor.overlay
2930

3031
Shell Module Command Help
3132
=========================

samples/sensor/sensor_shell/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ tests:
2222
timeout: 180
2323
extra_configs:
2424
- arch:posix:CONFIG_NATIVE_UART_0_ON_STDINOUT=y
25-
- CONFIG_SAMPLES_SENSOR_SHELL_FAKE_SENSOR=y
25+
extra_args: DTC_OVERLAY_FILE=fake_sensor.overlay
2626
integration_platforms:
2727
- native_sim

0 commit comments

Comments
 (0)