Skip to content

Commit eaccc2c

Browse files
PizzaAllTheWayeivindj-nordic
authored andcommitted
samples: subsystem: align LED and button behavior across samples
Align LED and button behavior across samples to follow a consistent and predictable convention. The goal is to make samples easier to understand, compare, and reuse by ensuring that common actions map to the same LEDs and buttons wherever possible. All changes were tested and verified on hardware, and all affected READMEs were updated to reflect the new behavior. Subsystem samples use LED0 to indicate initialization only. No additional LED or button behavior is defined for these samples. Signed-off-by: Martynas Smilingis <martynas.smilingis@nordicsemi.no>
1 parent e62c371 commit eaccc2c

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

samples/subsys/fs/bm_zms/README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ Kconfig fragments
7373
By default, the sample uses the SoftDevice storage backend.
7474
To configure it for this sample, follow the steps outlined in :ref:`sample_intro_config_build`.
7575

76+
User interface
77+
**************
78+
79+
LED 0:
80+
Lit when the ZMS storage has been successfully initialized by mounting and clearing the storage.
81+
7682
Building and running
7783
********************
7884

samples/subsys/fs/bm_zms/src/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <zephyr/kernel.h>
88
#include <zephyr/logging/log.h>
99
#include <zephyr/logging/log_ctrl.h>
10+
#include <hal/nrf_gpio.h>
11+
#include <board-config.h>
1012

1113
#define STORAGE_NODE DT_NODELABEL(storage0_partition)
1214
#define BM_ZMS_PARTITION_OFFSET DT_REG_ADDR(STORAGE_NODE)
@@ -184,6 +186,10 @@ int main(void)
184186
}
185187
wait_for_clear();
186188

189+
nrf_gpio_cfg_output(BOARD_PIN_LED_0);
190+
nrf_gpio_pin_write(BOARD_PIN_LED_0, BOARD_LED_ACTIVE_STATE);
191+
LOG_INF("BM_ZMS sample initialized");
192+
187193
for (i = 0; i < CONFIG_SAMPLE_BM_ZMS_ITERATIONS_MAX; i++) {
188194
rc = bm_zms_mount(&fs, &config);
189195
if (rc) {

samples/subsys/storage/bm_storage/README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ Kconfig fragments
7373
By default, the sample uses the SoftDevice storage backend.
7474
To configure it for this sample, follow the steps outlined in :ref:`sample_intro_config_build`.
7575

76+
User interface
77+
**************
78+
79+
LED 0:
80+
Lit when the device storage has been successfully initialized.
81+
7682
Building and running
7783
********************
7884

samples/subsys/storage/bm_storage/src/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include <bm/softdevice_handler/nrf_sdh.h>
1616
#include <nrf_soc.h>
17+
#include <hal/nrf_gpio.h>
18+
#include <board-config.h>
1719

1820
#include <bm/storage/bm_storage.h>
1921

@@ -238,6 +240,10 @@ int main(void)
238240
goto idle;
239241
}
240242

243+
nrf_gpio_cfg_output(BOARD_PIN_LED_0);
244+
nrf_gpio_pin_write(BOARD_PIN_LED_0, BOARD_LED_ACTIVE_STATE);
245+
LOG_INF("Storage sample initialized");
246+
241247
LOG_INF("Reading persisted data");
242248

243249
err = storage_reads();
@@ -280,7 +286,7 @@ int main(void)
280286
goto idle;
281287
}
282288

283-
LOG_INF("Storage sample finished.");
289+
LOG_INF("Storage sample finished");
284290

285291
idle:
286292
/* Enter main loop. */

0 commit comments

Comments
 (0)