Skip to content

Commit e81a08d

Browse files
nordicjmcfriedt
authored andcommitted
boards: nordic: nrf52840dongle: Replace SYS_INIT with board hooks
Updates to use board hooks since SYS_INIT should not be used in boards Signed-off-by: Jamie McCrae <[email protected]>
1 parent c85ff90 commit e81a08d

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

boards/nordic/nrf52840dongle/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
# Copyright (c) 2018-2023 Nordic Semiconductor ASA
44
# SPDX-License-Identifier: Apache-2.0
55

6-
if BOARD_NRF52840DONGLE
6+
config BOARD_NRF52840DONGLE
7+
select BOARD_EARLY_INIT_HOOK
78

89
config BOARD_HAS_NRF5_BOOTLOADER
910
bool "Board has nRF5 bootloader"
1011
default y
1112
help
1213
If selected, applications are linked so that they can be loaded by Nordic
1314
nRF5 bootloader.
14-
15-
endif # BOARD_NRF52840DONGLE

boards/nordic/nrf52840dongle/board.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
#include <zephyr/init.h>
88
#include <hal/nrf_power.h>
99

10-
static int board_nrf52840dongle_nrf52840_init(void)
10+
void board_early_init_hook(void)
1111
{
12-
13-
/* if the nrf52840dongle_nrf52840 board is powered from USB
12+
/* If the nrf52840dongle/nrf52840 board target is powered from USB
1413
* (high voltage mode), GPIO output voltage is set to 1.8 volts by
1514
* default and that is not enough to turn the green and blue LEDs on.
1615
* Increase GPIO voltage to 3.0 volts.
@@ -37,9 +36,4 @@ static int board_nrf52840dongle_nrf52840_init(void)
3736
/* a reset is required for changes to take effect */
3837
NVIC_SystemReset();
3938
}
40-
41-
return 0;
4239
}
43-
44-
SYS_INIT(board_nrf52840dongle_nrf52840_init, PRE_KERNEL_1,
45-
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

0 commit comments

Comments
 (0)