STM32F4-Discovery: Configure CAN2 GPIOs if UAVCAN uses two interfaces

This commit is contained in:
Paul A. Patience 2015-10-08 15:38:01 -04:00
parent dd468add8a
commit a778cb3a49
2 changed files with 10 additions and 1 deletions

View File

@ -237,13 +237,18 @@
#define BUTTON_USER_BIT (1 << BUTTON_USER)
/* Alternate function pin selections ************************************************/
/* CAN1 */
/* CAN */
#ifndef CONFIG_STM32_FSMC
# define GPIO_CAN1_RX GPIO_CAN1_RX_3
# define GPIO_CAN1_TX GPIO_CAN1_TX_3
#endif
#ifndef CONFIG_STM32_ETHMAC
# define GPIO_CAN2_RX GPIO_CAN2_RX_1
# define GPIO_CAN2_TX GPIO_CAN2_TX_1
#endif
/* UART2:
*
* The STM32F4 Discovery has no on-board serial devices, but the console is

View File

@ -107,6 +107,10 @@ void stm32_boardinitialize(void)
#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