examples/buttons: Eliminate 'too many initializers' warning.
This commit is contained in:
parent
58b521183d
commit
9b9a321637
@ -41,40 +41,40 @@ config EXAMPLES_BUTTONS_NAMES
|
|||||||
if EXAMPLES_BUTTONS_NAMES
|
if EXAMPLES_BUTTONS_NAMES
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_QTD
|
config EXAMPLES_BUTTONS_QTD
|
||||||
int "Quantity of Buttons in the Board"
|
int "Number of Buttons in the Board"
|
||||||
default 8
|
default 8
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_NAME0
|
config EXAMPLES_BUTTONS_NAME0
|
||||||
string "Button 0 Name"
|
string "Button 0 Name"
|
||||||
default "BUTTON0"
|
default "BUTTON0"
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_NAME1
|
config EXAMPLES_BUTTONS_NAME1
|
||||||
string "Button 1 Name"
|
string "Button 1 Name"
|
||||||
default "BUTTON1"
|
default "BUTTON1"
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_NAME2
|
config EXAMPLES_BUTTONS_NAME2
|
||||||
string "Button 2 Name"
|
string "Button 2 Name"
|
||||||
default "BUTTON2"
|
default "BUTTON2"
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_NAME3
|
config EXAMPLES_BUTTONS_NAME3
|
||||||
string "Button 3 Name"
|
string "Button 3 Name"
|
||||||
default "BUTTON3"
|
default "BUTTON3"
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_NAME4
|
config EXAMPLES_BUTTONS_NAME4
|
||||||
string "Button 4 Name"
|
string "Button 4 Name"
|
||||||
default "BUTTON4"
|
default "BUTTON4"
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_NAME5
|
config EXAMPLES_BUTTONS_NAME5
|
||||||
string "Button 5 Name"
|
string "Button 5 Name"
|
||||||
default "BUTTON5"
|
default "BUTTON5"
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_NAME6
|
config EXAMPLES_BUTTONS_NAME6
|
||||||
string "Button 6 Name"
|
string "Button 6 Name"
|
||||||
default "BUTTON6"
|
default "BUTTON6"
|
||||||
|
|
||||||
config EXAMPLES_BUTTONS_NAME7
|
config EXAMPLES_BUTTONS_NAME7
|
||||||
string "Button 7 Name"
|
string "Button 7 Name"
|
||||||
default "BUTTON7"
|
default "BUTTON7"
|
||||||
|
|
||||||
endif # EXAMPLES_BUTTONS_NAMES
|
endif # EXAMPLES_BUTTONS_NAMES
|
||||||
endif # EXAMPLES_BUTTONS
|
endif # EXAMPLES_BUTTONS
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/buttons/buttons_main.c
|
* examples/buttons/buttons_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2016-2027 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -123,24 +123,38 @@
|
|||||||
# error "CONFIG_EXAMPLES_BUTTONS_QTD > 8"
|
# error "CONFIG_EXAMPLES_BUTTONS_QTD > 8"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_BUTTONS_NAMES
|
|
||||||
char button_name[CONFIG_EXAMPLES_BUTTONS_QTD][16] =
|
|
||||||
{
|
|
||||||
CONFIG_EXAMPLES_BUTTONS_NAME0,
|
|
||||||
CONFIG_EXAMPLES_BUTTONS_NAME1,
|
|
||||||
CONFIG_EXAMPLES_BUTTONS_NAME2,
|
|
||||||
CONFIG_EXAMPLES_BUTTONS_NAME3,
|
|
||||||
CONFIG_EXAMPLES_BUTTONS_NAME4,
|
|
||||||
CONFIG_EXAMPLES_BUTTONS_NAME5,
|
|
||||||
CONFIG_EXAMPLES_BUTTONS_NAME6,
|
|
||||||
CONFIG_EXAMPLES_BUTTONS_NAME7,
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_EXAMPLES_BUTTONS_NAMES
|
||||||
|
static const char button_name[CONFIG_EXAMPLES_BUTTONS_QTD][16] =
|
||||||
|
{
|
||||||
|
CONFIG_EXAMPLES_BUTTONS_NAME0
|
||||||
|
#if CONFIG_EXAMPLES_BUTTONS_QTD > 1
|
||||||
|
, CONFIG_EXAMPLES_BUTTONS_NAME1
|
||||||
|
#endif
|
||||||
|
#if CONFIG_EXAMPLES_BUTTONS_QTD > 2
|
||||||
|
, CONFIG_EXAMPLES_BUTTONS_NAME2
|
||||||
|
#endif
|
||||||
|
#if CONFIG_EXAMPLES_BUTTONS_QTD > 3
|
||||||
|
, CONFIG_EXAMPLES_BUTTONS_NAME3
|
||||||
|
#endif
|
||||||
|
#if CONFIG_EXAMPLES_BUTTONS_QTD > 4
|
||||||
|
, CONFIG_EXAMPLES_BUTTONS_NAME4
|
||||||
|
#endif
|
||||||
|
#if CONFIG_EXAMPLES_BUTTONS_QTD > 5
|
||||||
|
, CONFIG_EXAMPLES_BUTTONS_NAME5
|
||||||
|
#endif
|
||||||
|
#if CONFIG_EXAMPLES_BUTTONS_QTD > 6
|
||||||
|
, CONFIG_EXAMPLES_BUTTONS_NAME6
|
||||||
|
#endif
|
||||||
|
#if CONFIG_EXAMPLES_BUTTONS_QTD > 7
|
||||||
|
, CONFIG_EXAMPLES_BUTTONS_NAME7
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool g_button_daemon_started;
|
static bool g_button_daemon_started;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user