Nucleo F303RE and STM32F4-Discovery: Configure CAN GPIOs in stm32_boardinitialize() instead of in board_app_initialize()

This commit is contained in:
Paul A. Patience 2015-10-08 13:05:06 -04:00
parent 5704609d03
commit dd468add8a
8 changed files with 15 additions and 97 deletions

View File

@ -41,8 +41,9 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
/****************************************************************************
* Pre-processor Definitions
@ -64,10 +65,5 @@
int board_app_initialize(void)
{
#ifdef CONFIG_CANUTILS_UAVCAN
(void)stm32_configgpio(GPIO_CAN1_RX);
(void)stm32_configgpio(GPIO_CAN1_TX);
#endif
return OK;
}

View File

@ -86,6 +86,11 @@ void stm32_boardinitialize(void)
}
#endif
#ifdef CONFIG_CANUTILS_UAVCAN
(void)stm32_configgpio(GPIO_CAN1_RX);
(void)stm32_configgpio(GPIO_CAN1_TX);
#endif
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS

View File

@ -136,4 +136,5 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
return NULL;
}
#endif /* CONFIG_LCD_SSD1351 */

View File

@ -471,13 +471,7 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y
#
# Board-Specific Options
#
CONFIG_LIB_BOARDCTL=y
# CONFIG_BOARDCTL_RESET is not set
# CONFIG_BOARDCTL_TSCTEST is not set
# CONFIG_BOARDCTL_ADCTEST is not set
# CONFIG_BOARDCTL_PWMTEST is not set
# CONFIG_BOARDCTL_GRAPHICS is not set
# CONFIG_BOARDCTL_IOCTL is not set
# CONFIG_LIB_BOARDCTL is not set
#
# RTOS Features

View File

@ -48,10 +48,6 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y)
CSRCS += stm32_buttons.c
endif
ifeq ($(CONFIG_LIB_BOARDCTL),y)
CSRCS += stm32_appinitialize.c
endif
ifeq ($(CONFIG_STM32_OTGFS),y)
CSRCS += stm32_usb.c
endif

View File

@ -1,73 +0,0 @@
/****************************************************************************
* configs/stm32f4discovery/src/stm32_appinitialize.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
* Paul Alexander Patience <paul-a.patience@polymtl.ca>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
****************************************************************************/
int board_app_initialize(void)
{
#ifdef CONFIG_CANUTILS_UAVCAN
(void)stm32_configgpio(GPIO_CAN1_RX);
(void)stm32_configgpio(GPIO_CAN1_TX);
#endif
return OK;
}

View File

@ -104,6 +104,11 @@ void stm32_boardinitialize(void)
}
#endif
#ifdef CONFIG_CANUTILS_UAVCAN
(void)stm32_configgpio(GPIO_CAN1_RX);
(void)stm32_configgpio(GPIO_CAN1_TX);
#endif
#ifdef CONFIG_ARCH_LEDS
/* Configure on-board LEDs if LED support has been selected. */

View File

@ -492,13 +492,7 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y
# Board-Specific Options
#
# CONFIG_STM32F4DISBB is not set
CONFIG_LIB_BOARDCTL=y
# CONFIG_BOARDCTL_RESET is not set
# CONFIG_BOARDCTL_TSCTEST is not set
# CONFIG_BOARDCTL_ADCTEST is not set
# CONFIG_BOARDCTL_PWMTEST is not set
# CONFIG_BOARDCTL_GRAPHICS is not set
# CONFIG_BOARDCTL_IOCTL is not set
# CONFIG_LIB_BOARDCTL is not set
#
# RTOS Features