diff --git a/configs/open1788/src/lpc17_autoleds.c b/configs/open1788/src/lpc17_autoleds.c index e49b768677..dc8bdc1522 100644 --- a/configs/open1788/src/lpc17_autoleds.c +++ b/configs/open1788/src/lpc17_autoleds.c @@ -56,6 +56,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in * any way. The following definitions are used to access individual LEDs. * diff --git a/configs/open1788/src/lpc17_boardinitialize.c b/configs/open1788/src/lpc17_boardinitialize.c index f66e4ac6cf..12109ea14e 100644 --- a/configs/open1788/src/lpc17_boardinitialize.c +++ b/configs/open1788/src/lpc17_boardinitialize.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/open1788/src/lpc17_boardinitialize.c * - * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -79,37 +79,42 @@ void lpc17_boardinitialize(void) #ifdef CONFIG_LPC17_EMC lpc17_emcinitialize(); + #ifdef CONFIG_LPC17_EXTDRAM open1788_sdram_initialize(); #endif + #ifdef CONFIG_LPC17_EXTNOR open1788_nor_initialize(); #endif + #ifdef CONFIG_LPC17_EXTNAND open1788_nand_initialize(); #endif #endif - /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak - * function open1788_sspdev_initialize() has been brought into the link. +#if defined(CONFIG_LPC17_SSP0) || defined(CONFIG_LPC17_SSP1) || \ + defined(CONFIG_LPC17_SSP2) + /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) + * the weak function open1788_sspdev_initialize() has been brought into + * the link. */ -#if defined(CONFIG_LPC17_SSP0) || defined(CONFIG_LPC17_SSP1) || defined(CONFIG_LPC17_SSP2) if (open1788_sspdev_initialize) { open1788_sspdev_initialize(); } #endif +#ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ -#ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif +#ifdef CONFIG_LPC17_LCD /* Configure the LCD GPIOs if LCD support has been selected. */ -#ifdef CONFIG_LPC17_LCD open1788_lcd_initialize(); #endif } diff --git a/configs/open1788/src/lpc17_bringup.c b/configs/open1788/src/lpc17_bringup.c index f9792b83a4..e2d8667a47 100644 --- a/configs/open1788/src/lpc17_bringup.c +++ b/configs/open1788/src/lpc17_bringup.c @@ -183,7 +183,8 @@ static int nsh_waiter(int argc, char *argv[]) /* Wait for the device to change state */ DEBUGVERIFY(CONN_WAIT(g_usbconn, &hport)); - syslog(LOG_INFO, "nsh_waiter: %s\n", hport->connected ? "connected" : "disconnected"); + syslog(LOG_INFO, "nsh_waiter: %s\n", + hport->connected ? "connected" : "disconnected"); /* Did we just become connected? */ @@ -348,6 +349,7 @@ static int nsh_usbhostinitialize(void) (main_t)nsh_waiter, (FAR char * const *)NULL); return pid < 0 ? -ENOEXEC : OK; } + return -ENODEV; } #else diff --git a/configs/open1788/src/lpc17_buttons.c b/configs/open1788/src/lpc17_buttons.c index f2e2fb5f27..f053f09366 100644 --- a/configs/open1788/src/lpc17_buttons.c +++ b/configs/open1788/src/lpc17_buttons.c @@ -54,13 +54,10 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ + /* The Open1788 supports several buttons. All will read "1" when open and "0" * when closed * @@ -102,10 +99,6 @@ static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] = }; #endif -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -137,9 +130,9 @@ void board_button_initialize(void) * Name: board_buttons * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons. * * board_buttons() may be called at any time to harvest the state of every * button. The state of the buttons is returned as a bitset with one @@ -177,14 +170,15 @@ uint32_t board_buttons(void) * Button support. * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_button_irq() may be called to register button interrupt handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_button_irq() may be called to register button + * interrupt handlers. * - * board_button_irq() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for the meaning - * of enumeration values. + * board_button_irq() may be called to register an interrupt handler that + * will be called when a button is depressed or released. The ID value is + * a button enumeration value that uniquely identifies a button resource. + * See the BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for + * the meaning of enumeration values. * * Note that board_button_irq() also enables button interrupts. Button * interrupts will remain enabled after the interrupt handler is attached. diff --git a/configs/open1788/src/lpc17_lcd.c b/configs/open1788/src/lpc17_lcd.c index 448ddc6ced..648d6203fc 100644 --- a/configs/open1788/src/lpc17_lcd.c +++ b/configs/open1788/src/lpc17_lcd.c @@ -50,14 +50,6 @@ #ifdef CONFIG_LPC17_LCD -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/open1788/src/lpc17_nandinitialize.c b/configs/open1788/src/lpc17_nandinitialize.c index 39565face2..40be0f8cea 100644 --- a/configs/open1788/src/lpc17_nandinitialize.c +++ b/configs/open1788/src/lpc17_nandinitialize.c @@ -51,14 +51,6 @@ #if defined(CONFIG_LPC17_EMC) && defined(CONFIG_LPC17_EXTNAND) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/open1788/src/lpc17_norinitialize.c b/configs/open1788/src/lpc17_norinitialize.c index f5b594a861..a942d345c3 100644 --- a/configs/open1788/src/lpc17_norinitialize.c +++ b/configs/open1788/src/lpc17_norinitialize.c @@ -51,14 +51,6 @@ #if defined(CONFIG_LPC17_EMC) && defined(CONFIG_LPC17_EXTNOR) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/open1788/src/lpc17_sdraminitialize.c b/configs/open1788/src/lpc17_sdraminitialize.c index 054faa029e..e81cda735d 100644 --- a/configs/open1788/src/lpc17_sdraminitialize.c +++ b/configs/open1788/src/lpc17_sdraminitialize.c @@ -57,6 +57,7 @@ /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ + /* The core clock is LPC17_EMCCLK which may be either LPC17_CCLK* (undivided), or * LPC17_CCLK / 2 as determined by settings in the board.h header file. * @@ -96,10 +97,6 @@ #define SDRAM_BASE 0xa0000000 /* CS0 */ -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/open1788/src/lpc17_touchscreen.c b/configs/open1788/src/lpc17_touchscreen.c index f614306979..eb63f52614 100644 --- a/configs/open1788/src/lpc17_touchscreen.c +++ b/configs/open1788/src/lpc17_touchscreen.c @@ -61,6 +61,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_INPUT diff --git a/configs/open1788/src/lpc17_userleds.c b/configs/open1788/src/lpc17_userleds.c index f8e350dd12..585ccd0870 100644 --- a/configs/open1788/src/lpc17_userleds.c +++ b/configs/open1788/src/lpc17_userleds.c @@ -71,6 +71,7 @@ /**************************************************************************** * Private Data ****************************************************************************/ + /* This array maps an LED number to GPIO pin configuration */ static uint32_t g_ledcfg[BOARD_NLEDS] = diff --git a/configs/open1788/src/open1788.h b/configs/open1788/src/open1788.h index f949c1103c..53431273c0 100644 --- a/configs/open1788/src/open1788.h +++ b/configs/open1788/src/open1788.h @@ -161,7 +161,7 @@ * Public Functions ************************************************************************************/ -/**************************************************************************** +/************************************************************************************ * Name: lpc17_bringup * * Description: @@ -173,7 +173,7 @@ * CONFIG_BOARD_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y : * Called from the NSH library via boardctl() * - ****************************************************************************/ + ************************************************************************************/ int lpc17_bringup(void);