Skip to content

Commit 5813eaf

Browse files
committed
Stop motors on save
1 parent f5593ad commit 5813eaf

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/js/msp/MSPHelper.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,6 +2790,11 @@ MspHelper.prototype.sendSerialConfig = function(callback) {
27902790
};
27912791

27922792
MspHelper.prototype.writeConfiguration = function(reboot, callback) {
2793+
// We need some protection when testing motors on motors tab
2794+
if (!FC.CONFIG.armingDisabled) {
2795+
this.setArmingEnabled(false, false);
2796+
}
2797+
27932798
setTimeout(function() {
27942799
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, function() {
27952800
gui_log(i18n.getMessage('configurationEepromSaved'));

src/js/tabs/motors.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,7 @@ motors.initialize = async function (callback) {
917917
// Send enable extended dshot telemetry command
918918
const buffer = [];
919919

920+
// this should include check for using extended dshot telemetry
920921
buffer.push8(DshotCommand.dshotCommandType_e.DSHOT_CMD_TYPE_BLOCKING);
921922
buffer.push8(255); // Send to all escs
922923
buffer.push8(1); // 1 command
@@ -994,6 +995,9 @@ motors.initialize = async function (callback) {
994995
}
995996
}
996997

998+
// After saving configuration [in another tab], arming will be disabled
999+
motorsRunning = motorsRunning && !FC.CONFIG.armingDisabled;
1000+
9971001
if (motorsRunning) {
9981002
motorsEnableTestModeElement.prop('checked', true).trigger('change');
9991003

0 commit comments

Comments
 (0)