From adfb6eccc2ace32f1857f9400ef5b6437154bc47 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Fri, 19 Aug 2011 13:20:40 +0200 Subject: [PATCH] fixed usage of GPS buffer in sim_posix --- flight/OpenPilot/System/inc/pios_config_posix.h | 1 + flight/OpenPilot/System/pios_board_posix.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/flight/OpenPilot/System/inc/pios_config_posix.h b/flight/OpenPilot/System/inc/pios_config_posix.h index 4b779cc49..e8701be90 100644 --- a/flight/OpenPilot/System/inc/pios_config_posix.h +++ b/flight/OpenPilot/System/inc/pios_config_posix.h @@ -36,6 +36,7 @@ #define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_FREERTOS #define PIOS_INCLUDE_COM +#define PIOS_INCLUDE_GPS #define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_TELEMETRY_RF #define PIOS_INCLUDE_UDP diff --git a/flight/OpenPilot/System/pios_board_posix.c b/flight/OpenPilot/System/pios_board_posix.c index 2480d0730..573291025 100644 --- a/flight/OpenPilot/System/pios_board_posix.c +++ b/flight/OpenPilot/System/pios_board_posix.c @@ -66,6 +66,7 @@ const struct pios_udp_cfg pios_udp_aux_cfg = { #define PIOS_COM_TELEM_RF_RX_BUF_LEN 192 #define PIOS_COM_TELEM_RF_TX_BUF_LEN 192 +#define PIOS_COM_GPS_RX_BUF_LEN 192 /* * Board specific number of devices. @@ -154,14 +155,16 @@ void PIOS_Board_Init(void) { #if defined(PIOS_INCLUDE_GPS) { uint32_t pios_udp_gps_id; - if (PIOS_USART_Init(&pios_udp_gps_id, &pios_udp_gps_cfg)) { + if (PIOS_UDP_Init(&pios_udp_gps_id, &pios_udp_gps_cfg)) { 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_RX_BUF_LEN); PIOS_Assert(rx_buffer); + PIOS_Assert(tx_buffer); if (PIOS_COM_Init(&pios_com_gps_id, &pios_udp_com_driver, pios_udp_gps_id, rx_buffer, PIOS_COM_GPS_RX_BUF_LEN, - NULL, 0)) { + rx_buffer, PIOS_COM_GPS_RX_BUF_LEN)) { PIOS_Assert(0); } }