Skip to content

Commit

Permalink
samples: sensor: Use dedicated overlay for fake sensor in sensor_shell
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kartben committed Feb 24, 2025
1 parent a2fffdc commit 86eea62
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions samples/sensor/sensor_shell/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

config SAMPLES_SENSOR_SHELL_FAKE_SENSOR
bool "Enable fake sensor"
default y
depends on DT_HAS_VND_FAKE_SENSOR_ENABLED
help
On boards that do not have a sensor, enabling this will build a fake
sensor that can be interacted with via the sensor shell.
Expand Down
5 changes: 3 additions & 2 deletions samples/sensor/sensor_shell/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ enabled, for example:
:board: reel_board
:goals: build flash

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

.. zephyr-app-commands::
:zephyr-app: samples/sensor/sensor_shell
:board: qemu_riscv64
:goals: run
:gen-args: -DCONFIG_SAMPLES_SENSOR_SHELL_FAKE_SENSOR=y
:gen-args: -DEXTRA_DTC_OVERLAY_FILE=fake_sensor.overlay

Shell Module Command Help
=========================
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion samples/sensor/sensor_shell/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ tests:
timeout: 180
extra_configs:
- arch:posix:CONFIG_NATIVE_UART_0_ON_STDINOUT=y
- CONFIG_SAMPLES_SENSOR_SHELL_FAKE_SENSOR=y
extra_args: DTC_OVERLAY_FILE=fake_sensor.overlay
integration_platforms:
- native_sim

0 comments on commit 86eea62

Please sign in to comment.