build: Define DECL_CONSTANT mechanism for defining exported constants

Add a DECL_CONSTANT macro to allow the firmware to define constants
that are to be exported to the host during the "identify" phase.  This
replaces the existing hardcoded mechanism of scanning the Kconfig
header file for certain constants.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-12-22 23:47:46 -05:00
parent 4e8674d5df
commit fe95ea221b
11 changed files with 54 additions and 37 deletions

View file

@ -9,6 +9,7 @@
#include "autoconf.h" // CONFIG_SERIAL_BAUD
#include "board/io.h" // readb
#include "board/misc.h" // console_get_input
#include "command.h" // DECL_CONSTANT
#include "sched.h" // DECL_INIT
#include "irq.h" // irq_save
@ -22,6 +23,8 @@ static uint8_t transmit_pos, transmit_max;
* Serial hardware
****************************************************************/
DECL_CONSTANT(SERIAL_BAUD, CONFIG_SERIAL_BAUD);
static void
serial_init(void)
{