Skip to content

Commit 07cbb4f

Browse files
Kerogitcederom
authored andcommitted
boards/avr/avrdx/breadxavr: silence unused variable warning
This patch silences a warning caused by unconditionally declared variable which is only used with specific configuration. Also, if the initialization fails, panic instead of returning. (This should not happen since the code runs in initialization phase but silently returning is not the correct action.) Signed-off-by: Kerogit <[email protected]>
1 parent 13a361a commit 07cbb4f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

boards/avr/avrdx/breadxavr/src/avrdx_init.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
# include <nuttx/input/buttons.h>
3333
#endif
3434

35+
#include <assert.h>
3536
#include <avr/io.h>
3637

3738
#include "avrdx_gpio.h"
@@ -77,13 +78,15 @@
7778
#ifdef CONFIG_BOARD_EARLY_INITIALIZE
7879
void board_early_initialize(void)
7980
{
81+
# ifdef CONFIG_BREADXAVR_BUTTONS_DRIVER
8082
int ret = OK;
83+
# endif
8184

8285
# ifdef CONFIG_BREADXAVR_BUTTONS_DRIVER
8386
ret = btn_lower_initialize("/dev/buttons");
8487
if (ret != OK)
8588
{
86-
return;
89+
PANIC();
8790
}
8891
# endif
8992
}

0 commit comments

Comments
 (0)