Skip to content

Commit

Permalink
Fixed motor tab for BF 3.1.x. Fixed #568
Browse files Browse the repository at this point in the history
  • Loading branch information
basdelfos committed Jul 30, 2017
1 parent 70c69b8 commit ca39c71
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tabs/motors.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ TABS.motors.initialize = function (callback) {
$('#content').load("./tabs/motors.html", process_html);
}

MSP.send_message(MSPCodes.MSP_MOTOR_CONFIG, false, false, get_arm_status);
// Get information from Betaflight
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
// BF 3.2.0+
MSP.send_message(MSPCodes.MSP_MOTOR_CONFIG, false, false, get_arm_status);
} else {
// BF 3.1.x or older
MSP.send_message(MSPCodes.MSP_MISC, false, false, get_arm_status);
}

function update_arm_status() {
self.armed = bit_check(CONFIG.mode, 0);
Expand Down

0 comments on commit ca39c71

Please sign in to comment.