Skip to content

Commit fb074bd

Browse files
samples: Remove snippets from samples
We should store our snippets in the root directory instead of sample's one. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
1 parent 389c916 commit fb074bd

5 files changed

Lines changed: 5 additions & 23 deletions

File tree

samples/light_switch/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ config LIGHT_SWITCH_TX_POWER
5252

5353
config LIGHT_SWITCH_LOW_POWER
5454
bool "Low power mode"
55-
default n
55+
default y
56+
depends on PM_DEVICE
5657
help
5758
Enable low power mode for the Light Switch sample.
5859
This enables sleepy behavior and disables LEDs for power savings.

samples/light_switch/snippets/low_power/boards/nrf52840dk_nrf52840.conf

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/light_switch/src/app_task_zigbee.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
LOG_MODULE_REGISTER(zb_lightswitch, LOG_LEVEL_INF);
117117

118118
/* Helper functions for LED control in low power mode */
119-
#if CONFIG_LIGHT_SWITCH_LOW_POWER
119+
#if defined(CONFIG_LIGHT_SWITCH_LOW_POWER)
120120
static inline void led_set(uint32_t led, uint32_t val) { ARG_UNUSED(led); ARG_UNUSED(val); }
121121
static inline void led_set_on(uint32_t led) { ARG_UNUSED(led); }
122122
static inline void led_set_off(uint32_t led) { ARG_UNUSED(led); }
@@ -388,7 +388,7 @@ static void configure_gpio(void)
388388
LOG_ERR("Cannot init buttons (err: %d)", err);
389389
}
390390

391-
#if !CONFIG_LIGHT_SWITCH_LOW_POWER
391+
#if !defined(CONFIG_LIGHT_SWITCH_LOW_POWER)
392392
err = dk_leds_init();
393393
if (err) {
394394
LOG_ERR("Cannot init LEDs (err: %d)", err);
@@ -923,7 +923,7 @@ int ZigbeeStart(void)
923923
/* Check if sleepy button is pressed during Zigbee initialization
924924
* and enable sleepy behavior. In low power mode, always enable sleepy behavior.
925925
*/
926-
#if CONFIG_LIGHT_SWITCH_LOW_POWER
926+
#if defined(CONFIG_LIGHT_SWITCH_LOW_POWER)
927927
bool enable_sleepy = true;
928928
#elif defined(CONFIG_CHIP)
929929
bool enable_sleepy = false;

samples/light_switch/snippets/low_power/low_power.conf renamed to snippets/low_power/low_power.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
# Low power configuration for Zigbee Light Switch
8-
CONFIG_LIGHT_SWITCH_LOW_POWER=y
9-
107
# Disable serial and console for power savings
118
CONFIG_SERIAL=n
129
CONFIG_CONSOLE=n

samples/light_switch/snippets/low_power/snippet.yml renamed to snippets/low_power/snippet.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,3 @@
77
name: low_power
88
append:
99
EXTRA_CONF_FILE: low_power.conf
10-
11-
boards:
12-
nrf52840dk/nrf52840:
13-
append:
14-
EXTRA_CONF_FILE: boards/nrf52840dk_nrf52840.conf

0 commit comments

Comments
 (0)