Skip to content

Commit

Permalink
Fix mag declination (#3801)
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Feb 16, 2024
1 parent c289445 commit aeeded6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ MspHelper.prototype.crunch = function(code, modifierCode = undefined) {
}
break;
case MSPCodes.MSP_SET_COMPASS_CONFIG:
buffer.push16(Math.round(FC.COMPASS_CONFIG.mag_declination) * 10);
buffer.push16(Math.round(10.0 * parseFloat(FC.COMPASS_CONFIG.mag_declination)));
break;
case MSPCodes.MSP_SET_RSSI_CONFIG:
buffer.push8(FC.RSSI_CONFIG.channel);
Expand Down
2 changes: 1 addition & 1 deletion src/js/tabs/gps.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ gps.initialize = async function (callback) {
// fill some data
FC.GPS_CONFIG.auto_baud = $('input[name="gps_auto_baud"]').is(':checked') ? 1 : 0;
FC.GPS_CONFIG.auto_config = $('input[name="gps_auto_config"]').is(':checked') ? 1 : 0;
FC.COMPASS_CONFIG.mag_declination = parseFloat($('input[name="mag_declination"]').val());
FC.COMPASS_CONFIG.mag_declination = $('input[name="mag_declination"]').val();

await MSP.promise(MSPCodes.MSP_SET_FEATURE_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FEATURE_CONFIG));
if (hasMag) {
Expand Down

0 comments on commit aeeded6

Please sign in to comment.