From 85aef9c7b46caff6e6a7913fe32117f06b53cc17 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Fri, 19 Aug 2011 20:20:44 +0200 Subject: [PATCH] OpenPilot: bugfix: Add GPS tx buffer by default (needed until GPS has been refactored to not send or only send when configured so) --- flight/OpenPilot/System/inc/pios_config.h | 1 + flight/OpenPilot/System/pios_board.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/flight/OpenPilot/System/inc/pios_config.h b/flight/OpenPilot/System/inc/pios_config.h index 4d561382e..4e6657cef 100644 --- a/flight/OpenPilot/System/inc/pios_config.h +++ b/flight/OpenPilot/System/inc/pios_config.h @@ -60,6 +60,7 @@ //#define PIOS_INCLUDE_HCSR04 #define PIOS_INCLUDE_OPAHRS #define PIOS_INCLUDE_COM +#define PIOS_INCLUDE_GPS #define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_SETTINGS #define PIOS_INCLUDE_FREERTOS diff --git a/flight/OpenPilot/System/pios_board.c b/flight/OpenPilot/System/pios_board.c index fbc4419a1..f4ac5c367 100644 --- a/flight/OpenPilot/System/pios_board.c +++ b/flight/OpenPilot/System/pios_board.c @@ -525,6 +525,7 @@ static const struct pios_spektrum_cfg pios_spektrum_cfg = { #define PIOS_COM_TELEM_RF_TX_BUF_LEN 192 #define PIOS_COM_GPS_RX_BUF_LEN 96 +#define PIOS_COM_GPS_TX_BUF_LEN 96 #define PIOS_COM_TELEM_USB_RX_BUF_LEN 192 #define PIOS_COM_TELEM_USB_TX_BUF_LEN 192 @@ -1074,10 +1075,12 @@ void PIOS_Board_Init(void) { PIOS_Assert(0); } uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_GPS_RX_BUF_LEN); + uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_GPS_TX_BUF_LEN); PIOS_Assert(rx_buffer); + PIOS_Assert(tx_buffer); if (PIOS_COM_Init(&pios_com_gps_id, &pios_usart_com_driver, pios_usart_gps_id, rx_buffer, PIOS_COM_GPS_RX_BUF_LEN, - NULL, 0)) { + tx_buffer, PIOS_COM_GPS_TX_BUF_LEN)) { PIOS_Assert(0); } }