Merged in paulpatience/nuttx-boards (pull request #12)
Nucleo F303RE and STM32F4-Discovery: Change how CAN GPIOs are configured
This commit is contained in:
commit
8be7ddde34
@ -41,8 +41,9 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
#include <arch/board/board.h>
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@ -64,10 +65,5 @@
|
|||||||
|
|
||||||
int board_app_initialize(void)
|
int board_app_initialize(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_CANUTILS_UAVCAN
|
|
||||||
(void)stm32_configgpio(GPIO_CAN1_RX);
|
|
||||||
(void)stm32_configgpio(GPIO_CAN1_TX);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,11 @@ void stm32_boardinitialize(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#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. */
|
/* Configure on-board LEDs if LED support has been selected. */
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
|
@ -136,4 +136,5 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_LCD_SSD1351 */
|
#endif /* CONFIG_LCD_SSD1351 */
|
||||||
|
@ -471,13 +471,7 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y
|
|||||||
#
|
#
|
||||||
# Board-Specific Options
|
# Board-Specific Options
|
||||||
#
|
#
|
||||||
CONFIG_LIB_BOARDCTL=y
|
# CONFIG_LIB_BOARDCTL is not set
|
||||||
# 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
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# RTOS Features
|
# RTOS Features
|
||||||
|
@ -237,13 +237,18 @@
|
|||||||
#define BUTTON_USER_BIT (1 << BUTTON_USER)
|
#define BUTTON_USER_BIT (1 << BUTTON_USER)
|
||||||
|
|
||||||
/* Alternate function pin selections ************************************************/
|
/* Alternate function pin selections ************************************************/
|
||||||
/* CAN1 */
|
/* CAN */
|
||||||
|
|
||||||
#ifndef CONFIG_STM32_FSMC
|
#ifndef CONFIG_STM32_FSMC
|
||||||
# define GPIO_CAN1_RX GPIO_CAN1_RX_3
|
# define GPIO_CAN1_RX GPIO_CAN1_RX_3
|
||||||
# define GPIO_CAN1_TX GPIO_CAN1_TX_3
|
# define GPIO_CAN1_TX GPIO_CAN1_TX_3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_STM32_ETHMAC
|
||||||
|
# define GPIO_CAN2_RX GPIO_CAN2_RX_1
|
||||||
|
# define GPIO_CAN2_TX GPIO_CAN2_TX_1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* UART2:
|
/* UART2:
|
||||||
*
|
*
|
||||||
* The STM32F4 Discovery has no on-board serial devices, but the console is
|
* The STM32F4 Discovery has no on-board serial devices, but the console is
|
||||||
|
@ -48,10 +48,6 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y)
|
|||||||
CSRCS += stm32_buttons.c
|
CSRCS += stm32_buttons.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
|
||||||
CSRCS += stm32_appinitialize.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_STM32_OTGFS),y)
|
ifeq ($(CONFIG_STM32_OTGFS),y)
|
||||||
CSRCS += stm32_usb.c
|
CSRCS += stm32_usb.c
|
||||||
endif
|
endif
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -104,6 +104,15 @@ void stm32_boardinitialize(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_CANUTILS_UAVCAN
|
||||||
|
(void)stm32_configgpio(GPIO_CAN1_RX);
|
||||||
|
(void)stm32_configgpio(GPIO_CAN1_TX);
|
||||||
|
# if CONFIG_UAVCAN_STM32_NUM_IFACES > 1
|
||||||
|
(void)stm32_configgpio(GPIO_CAN2_RX);
|
||||||
|
(void)stm32_configgpio(GPIO_CAN2_TX);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
/* Configure on-board LEDs if LED support has been selected. */
|
/* Configure on-board LEDs if LED support has been selected. */
|
||||||
|
|
||||||
|
@ -492,13 +492,7 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y
|
|||||||
# Board-Specific Options
|
# Board-Specific Options
|
||||||
#
|
#
|
||||||
# CONFIG_STM32F4DISBB is not set
|
# CONFIG_STM32F4DISBB is not set
|
||||||
CONFIG_LIB_BOARDCTL=y
|
# CONFIG_LIB_BOARDCTL is not set
|
||||||
# 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
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# RTOS Features
|
# RTOS Features
|
||||||
|
Loading…
Reference in New Issue
Block a user