1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-21 06:52:11 +01:00

fixed usage of GPS buffer in sim_posix

This commit is contained in:
Corvus Corax 2011-08-19 13:20:40 +02:00
parent 9ad85e9b7b
commit adfb6eccc2
2 changed files with 6 additions and 2 deletions

View File

@ -36,6 +36,7 @@
#define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_SDCARD
#define PIOS_INCLUDE_FREERTOS #define PIOS_INCLUDE_FREERTOS
#define PIOS_INCLUDE_COM #define PIOS_INCLUDE_COM
#define PIOS_INCLUDE_GPS
#define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_IRQ
#define PIOS_INCLUDE_TELEMETRY_RF #define PIOS_INCLUDE_TELEMETRY_RF
#define PIOS_INCLUDE_UDP #define PIOS_INCLUDE_UDP

View File

@ -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_RX_BUF_LEN 192
#define PIOS_COM_TELEM_RF_TX_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. * Board specific number of devices.
@ -154,14 +155,16 @@ void PIOS_Board_Init(void) {
#if defined(PIOS_INCLUDE_GPS) #if defined(PIOS_INCLUDE_GPS)
{ {
uint32_t pios_udp_gps_id; 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); PIOS_Assert(0);
} }
uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_GPS_RX_BUF_LEN); 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(rx_buffer);
PIOS_Assert(tx_buffer);
if (PIOS_COM_Init(&pios_com_gps_id, &pios_udp_com_driver, pios_udp_gps_id, if (PIOS_COM_Init(&pios_com_gps_id, &pios_udp_com_driver, pios_udp_gps_id,
rx_buffer, PIOS_COM_GPS_RX_BUF_LEN, rx_buffer, PIOS_COM_GPS_RX_BUF_LEN,
NULL, 0)) { rx_buffer, PIOS_COM_GPS_RX_BUF_LEN)) {
PIOS_Assert(0); PIOS_Assert(0);
} }
} }