Skip to content

Commit 188e259

Browse files
committed
Add board_init2 and board_teardown2
This also replace `board_init_extra`.
1 parent 80c3a84 commit 188e259

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/boards/boards.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ bool button_pressed(uint32_t pin)
6363
}
6464

6565
// This is declared so that a board specific init can be called from here.
66-
void __attribute__((weak)) board_init_extra(void) { }
66+
void __attribute__((weak)) board_init2(void) { }
67+
6768
void board_init(void)
6869
{
6970
// stop LF clock just in case we jump from application without reset
@@ -96,7 +97,7 @@ void board_init(void)
9697
NRF_POWER->DCDCEN = 1;
9798
#endif
9899
// Make sure any custom inits are performed
99-
board_init_extra();
100+
board_init2();
100101

101102
// When board is supplied on VDDH (and not VDD), this specifies what voltage the GPIO should run at
102103
// and what voltage is output at VDD. The default (0xffffffff) is 1.8V; typically you'll want
@@ -129,6 +130,9 @@ void board_init(void)
129130
SysTick_Config(SystemCoreClock/1000);
130131
}
131132

133+
// Actions at the end of board_teardown.
134+
void __attribute__((weak)) board_teardown2(void) { }
135+
132136
void board_teardown(void)
133137
{
134138
// Disable systick, turn off LEDs
@@ -159,6 +163,9 @@ void board_teardown(void)
159163
{
160164
nrf_gpio_cfg_default(i);
161165
}
166+
167+
// board specific teardown actions
168+
board_teardown2();
162169
}
163170

164171
static uint32_t _systick_count = 0;

src/boards/challenger_840_ble/pinconfig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const uint32_t bootloaderConfig[] =
1919
/* CF2 END */
2020
};
2121

22-
void board_init_extra(void)
22+
void board_init2(void)
2323
{
2424
// Turn LDO on
2525
nrf_gpio_cfg_output(LDO_CONTROL_PIN);

0 commit comments

Comments
 (0)