1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Updating HoTT GPS Altitude code to match spec.

Unit test added.
This commit is contained in:
Dominic Clifton 2014-05-28 21:32:13 +01:00
parent 79a90b09ef
commit bbfebc5de9
3 changed files with 27 additions and 2 deletions

View file

@ -171,8 +171,10 @@ void hottPrepareGPSResponse(HOTT_GPS_MSG_t *hottGPSMessage)
hottGPSMessage->home_distance_L = GPS_distanceToHome & 0x00FF;
hottGPSMessage->home_distance_H = GPS_distanceToHome >> 8;
hottGPSMessage->altitude_L = GPS_altitude & 0x00FF;
hottGPSMessage->altitude_H = GPS_altitude >> 8;
uint16_t hottGpsAltitude = (GPS_altitude / 10) + HOTT_GPS_ALTITUDE_OFFSET; // 1 / 0.1f == 10, GPS_altitude of 1 == 0.1m
hottGPSMessage->altitude_L = hottGpsAltitude & 0x00FF;
hottGPSMessage->altitude_H = hottGpsAltitude >> 8;
hottGPSMessage->home_direction = GPS_directionToHome;
}

View file

@ -27,6 +27,8 @@
#define HOTT_EAM_OFFSET_M3S 120
#define HOTT_EAM_OFFSET_TEMPERATURE 20
#define HOTT_GPS_ALTITUDE_OFFSET 500
typedef enum {
HOTT_EAM_ALARM1_FLAG_NONE = 0,
HOTT_EAM_ALARM1_FLAG_MAH = (1 << 0),
@ -476,4 +478,7 @@ void configureHoTTTelemetryPort(void);
void freeHoTTTelemetryPort(void);
uint32_t getHoTTTelemetryProviderBaudRate(void);
void hottPrepareGPSResponse(HOTT_GPS_MSG_t *hottGPSMessage);
#endif /* TELEMETRY_HOTT_H_ */