From 56c4ff8f40532524ceaea6d07f23780ee8399582 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Wed, 28 Dec 2011 16:17:10 -0500 Subject: [PATCH] com-bridge: add support for bridging to flexiport --- flight/CopterControl/System/pios_board.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/flight/CopterControl/System/pios_board.c b/flight/CopterControl/System/pios_board.c index 385c03283..3a28f5d4c 100644 --- a/flight/CopterControl/System/pios_board.c +++ b/flight/CopterControl/System/pios_board.c @@ -1316,6 +1316,24 @@ void PIOS_Board_Init(void) { } #endif /* PIOS_INCLUDE_TELEMETRY_RF */ break; + case HWSETTINGS_CC_FLEXIPORT_COMBRIDGE: + { + uint32_t pios_usart_generic_id; + if (PIOS_USART_Init(&pios_usart_generic_id, &pios_usart_generic_flexi_cfg)) { + PIOS_Assert(0); + } + + uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_BRIDGE_RX_BUF_LEN); + uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_BRIDGE_TX_BUF_LEN); + PIOS_Assert(rx_buffer); + PIOS_Assert(tx_buffer); + if (PIOS_COM_Init(&pios_com_bridge_id, &pios_usart_com_driver, pios_usart_generic_id, + rx_buffer, PIOS_COM_BRIDGE_RX_BUF_LEN, + tx_buffer, PIOS_COM_BRIDGE_TX_BUF_LEN)) { + PIOS_Assert(0); + } + } + break; case HWSETTINGS_CC_FLEXIPORT_GPS: #if defined(PIOS_INCLUDE_GPS) { @@ -1387,8 +1405,6 @@ void PIOS_Board_Init(void) { } #endif /* PIOS_INCLUDE_I2C */ break; - case HWSETTINGS_CC_FLEXIPORT_COMBRIDGE: - break; } /* Configure the rcvr port */