mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Tidy up NMEA Code A Little
Still a LOT of tidying up needed in future, of the whole GPS module really.
This commit is contained in:
parent
b8b248827c
commit
c226f6a412
1 changed files with 115 additions and 113 deletions
|
@ -69,6 +69,8 @@ extern int16_t debug[4];
|
|||
#define LOG_UBLOX_POSLLH 'P'
|
||||
#define LOG_UBLOX_VELNED 'V'
|
||||
|
||||
#define GPS_SV_MAXSATS 16
|
||||
|
||||
char gpsPacketLog[GPS_PACKET_LOG_ENTRY_COUNT];
|
||||
static char *gpsPacketLogChar = gpsPacketLog;
|
||||
// **********************
|
||||
|
@ -86,10 +88,10 @@ uint16_t GPS_speed; // speed in 0.1m/s
|
|||
uint16_t GPS_ground_course = 0; // degrees * 10
|
||||
|
||||
uint8_t GPS_numCh; // Number of channels
|
||||
uint8_t GPS_svinfo_chn[16]; // Channel number
|
||||
uint8_t GPS_svinfo_svid[16]; // Satellite ID
|
||||
uint8_t GPS_svinfo_quality[16]; // Bitfield Qualtity
|
||||
uint8_t GPS_svinfo_cno[16]; // Carrier to Noise Ratio (Signal Strength)
|
||||
uint8_t GPS_svinfo_chn[GPS_SV_MAXSATS]; // Channel number
|
||||
uint8_t GPS_svinfo_svid[GPS_SV_MAXSATS]; // Satellite ID
|
||||
uint8_t GPS_svinfo_quality[GPS_SV_MAXSATS]; // Bitfield Qualtity
|
||||
uint8_t GPS_svinfo_cno[GPS_SV_MAXSATS]; // Carrier to Noise Ratio (Signal Strength)
|
||||
|
||||
static gpsConfig_t *gpsConfig;
|
||||
|
||||
|
@ -514,18 +516,18 @@ static uint32_t grab_fields(char *src, uint8_t mult)
|
|||
return tmp;
|
||||
}
|
||||
|
||||
static bool gpsNewFrameNMEA(char c)
|
||||
{
|
||||
typedef struct gpsdata_s {
|
||||
typedef struct gpsDataNmea_s {
|
||||
int32_t latitude;
|
||||
int32_t longitude;
|
||||
uint8_t numSat;
|
||||
uint16_t altitude;
|
||||
uint16_t speed;
|
||||
uint16_t ground_course;
|
||||
} gpsdata_t;
|
||||
} gpsDataNmea_t;
|
||||
|
||||
static gpsdata_t gps_Msg;
|
||||
static bool gpsNewFrameNMEA(char c)
|
||||
{
|
||||
static gpsDataNmea_t gps_Msg;
|
||||
|
||||
uint8_t frameOK = 0;
|
||||
static uint8_t param = 0, offset = 0, parity = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue