1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 03:20:00 +03:00

Revive MSP message for mag declination (#13232)

Add MSP message for mag declination
This commit is contained in:
Mark Haslinghuis 2023-12-19 13:26:15 +01:00 committed by GitHub
parent 15246eebab
commit 58933f9972
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View file

@ -1457,6 +1457,11 @@ case MSP_NAME:
#endif
break;
#ifdef USE_MAG
case MSP_COMPASS_CONFIG:
sbufWriteU16(dst, imuConfig()->mag_declination);
break;
#endif
// Deprecated in favor of MSP_MOTOR_TELEMETY as of API version 1.42
// Used by DJI FPV
case MSP_ESC_SENSOR_DATA:
@ -2842,7 +2847,15 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
gpsConfigMutable()->gps_ublox_use_galileo = sbufReadU8(src);
}
break;
#endif
#ifdef USE_MAG
case MSP_SET_COMPASS_CONFIG:
imuConfigMutable()->mag_declination = sbufReadU16(src);
break;
#endif
#ifdef USE_GPS
#ifdef USE_GPS_RESCUE
case MSP_SET_GPS_RESCUE:
gpsRescueConfigMutable()->maxRescueAngle = sbufReadU16(src);