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

OP-1601 Ubx only, more efficient to save Ram on CC/CC3D

This commit is contained in:
Laurent Lalanne 2015-02-07 17:02:59 +01:00
parent f378ca6da7
commit f92eba93ef
2 changed files with 11 additions and 5 deletions

View File

@ -91,7 +91,12 @@ void updateGpsSettings(UAVObjEvent *ev);
#else #else
#if defined(PIOS_GPS_MINIMAL) #if defined(PIOS_GPS_MINIMAL)
#define GPS_READ_BUFFER 32 #define GPS_READ_BUFFER 32
#define STACK_SIZE_BYTES 580
#ifdef PIOS_INCLUDE_GPS_NMEA_PARSER
#define STACK_SIZE_BYTES 580 // NMEA
#else
#define STACK_SIZE_BYTES 440 // UBX
#endif // PIOS_INCLUDE_GPS_NMEA_PARSER
#else #else
#define STACK_SIZE_BYTES 650 #define STACK_SIZE_BYTES 650
#endif // PIOS_GPS_MINIMAL #endif // PIOS_GPS_MINIMAL
@ -203,9 +208,11 @@ int32_t GPSInitialize(void)
GPSSettingsInitialize(); GPSSettingsInitialize();
GPSSettingsDataProtocolGet(&gpsProtocol); GPSSettingsDataProtocolGet(&gpsProtocol);
switch (gpsProtocol) { switch (gpsProtocol) {
#if defined(PIOS_INCLUDE_GPS_NMEA_PARSER)
case GPSSETTINGS_DATAPROTOCOL_NMEA: case GPSSETTINGS_DATAPROTOCOL_NMEA:
gps_rx_buffer = pios_malloc(NMEA_MAX_PACKET_LENGTH); gps_rx_buffer = pios_malloc(NMEA_MAX_PACKET_LENGTH);
break; break;
#endif
case GPSSETTINGS_DATAPROTOCOL_UBX: case GPSSETTINGS_DATAPROTOCOL_UBX:
gps_rx_buffer = pios_malloc(sizeof(struct UBXPacket)); gps_rx_buffer = pios_malloc(sizeof(struct UBXPacket));
break; break;
@ -459,12 +466,12 @@ static void updateHwSettings()
} }
} }
#ifdef PIOS_INCLUDE_GPS_UBX_PARSER #if defined(PIOS_INCLUDE_GPS_UBX_PARSER) && !defined(PIOS_GPS_MINIMAL)
void AuxMagSettingsUpdatedCb(__attribute__((unused)) UAVObjEvent *ev) void AuxMagSettingsUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
{ {
load_mag_settings(); load_mag_settings();
} }
#if defined(PIOS_INCLUDE_GPS_UBX_PARSER) && !defined(PIOS_GPS_MINIMAL)
void updateGpsSettings(__attribute__((unused)) UAVObjEvent *ev) void updateGpsSettings(__attribute__((unused)) UAVObjEvent *ev)
{ {
uint8_t ubxAutoConfig; uint8_t ubxAutoConfig;
@ -537,7 +544,6 @@ void updateGpsSettings(__attribute__((unused)) UAVObjEvent *ev)
ubx_autoconfig_set(newconfig); ubx_autoconfig_set(newconfig);
} }
#endif /* if defined(PIOS_INCLUDE_GPS_UBX_PARSER) && !defined(PIOS_GPS_MINIMAL) */ #endif /* if defined(PIOS_INCLUDE_GPS_UBX_PARSER) && !defined(PIOS_GPS_MINIMAL) */
#endif /* ifdef PIOS_INCLUDE_GPS_UBX_PARSER */
/** /**
* @} * @}
* @} * @}

View File

@ -142,7 +142,7 @@
/* #define PIOS_TELEM_PRIORITY_QUEUE */ /* #define PIOS_TELEM_PRIORITY_QUEUE */
#define PIOS_INCLUDE_GPS #define PIOS_INCLUDE_GPS
#define PIOS_GPS_MINIMAL #define PIOS_GPS_MINIMAL
#define PIOS_INCLUDE_GPS_NMEA_PARSER /* #define PIOS_INCLUDE_GPS_NMEA_PARSER */
#define PIOS_INCLUDE_GPS_UBX_PARSER #define PIOS_INCLUDE_GPS_UBX_PARSER
/* #define PIOS_GPS_SETS_HOMELOCATION */ /* #define PIOS_GPS_SETS_HOMELOCATION */