diff --git a/samples/sensor/sensor_shell/Kconfig b/samples/sensor/sensor_shell/Kconfig index 38fcdfa7eb6..8d274a19032 100644 --- a/samples/sensor/sensor_shell/Kconfig +++ b/samples/sensor/sensor_shell/Kconfig @@ -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. diff --git a/samples/sensor/sensor_shell/README.rst b/samples/sensor/sensor_shell/README.rst index 9853157d89f..65653741bc2 100644 --- a/samples/sensor/sensor_shell/README.rst +++ b/samples/sensor/sensor_shell/README.rst @@ -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 ========================= diff --git a/samples/sensor/sensor_shell/app.overlay b/samples/sensor/sensor_shell/fake_sensor.overlay similarity index 100% rename from samples/sensor/sensor_shell/app.overlay rename to samples/sensor/sensor_shell/fake_sensor.overlay diff --git a/samples/sensor/sensor_shell/sample.yaml b/samples/sensor/sensor_shell/sample.yaml index a694f140589..15b9defabbc 100644 --- a/samples/sensor/sensor_shell/sample.yaml +++ b/samples/sensor/sensor_shell/sample.yaml @@ -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