mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 01:35:28 +03:00
Fix motor stop
This commit is contained in:
parent
8054aa7fa9
commit
f57255920a
2 changed files with 9 additions and 15 deletions
|
@ -1741,10 +1741,10 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
console.log(`Unknown code detected: ${code}`);
|
console.log(`Unknown code detected: ${code}`);
|
||||||
} else {
|
} else {
|
||||||
console.log(`FC reports unsupported message error: ${code}`);
|
console.log(`FC reports unsupported message error: ${code}`);
|
||||||
}
|
|
||||||
|
|
||||||
if (code === MSPCodes.MSP_SET_REBOOT) {
|
if (code === MSPCodes.MSP_SET_REBOOT) {
|
||||||
TABS.onboard_logging.mscRebootFailedCallback();
|
TABS.onboard_logging.mscRebootFailedCallback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -55,9 +55,7 @@ motors.initialize = async function (callback) {
|
||||||
// Update filtering defaults based on API version
|
// Update filtering defaults based on API version
|
||||||
const FILTER_DEFAULT = FC.getFilterDefaults();
|
const FILTER_DEFAULT = FC.getFilterDefaults();
|
||||||
|
|
||||||
if (GUI.active_tab != 'motors') {
|
GUI.active_tab = 'motors';
|
||||||
GUI.active_tab = 'motors';
|
|
||||||
}
|
|
||||||
|
|
||||||
await MSP.promise(MSPCodes.MSP_STATUS);
|
await MSP.promise(MSPCodes.MSP_STATUS);
|
||||||
await MSP.promise(MSPCodes.MSP_PID_ADVANCED);
|
await MSP.promise(MSPCodes.MSP_PID_ADVANCED);
|
||||||
|
@ -884,7 +882,7 @@ motors.initialize = async function (callback) {
|
||||||
];
|
];
|
||||||
|
|
||||||
motorsEnableTestModeElement.on('change', function () {
|
motorsEnableTestModeElement.on('change', function () {
|
||||||
let enabled = $(this).is(':checked');
|
let enabled = motorsEnableTestModeElement.is(':checked');
|
||||||
// prevent or disable testing if configHasChanged flag is set.
|
// prevent or disable testing if configHasChanged flag is set.
|
||||||
if (self.configHasChanged) {
|
if (self.configHasChanged) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
|
@ -900,17 +898,13 @@ motors.initialize = async function (callback) {
|
||||||
if (motorsEnableTestModeElement.is(':checked')) {
|
if (motorsEnableTestModeElement.is(':checked')) {
|
||||||
if (!ignoreKeys.includes(e.code)) {
|
if (!ignoreKeys.includes(e.code)) {
|
||||||
motorsEnableTestModeElement.prop('checked', false).trigger('change');
|
motorsEnableTestModeElement.prop('checked', false).trigger('change');
|
||||||
|
document.removeEventListener('keydown', evt => disableMotorTest(evt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
document.addEventListener('keydown', e => disableMotorTest(e));
|
document.addEventListener('keydown', e => disableMotorTest(e));
|
||||||
// enable Status and Motor data pulling
|
|
||||||
GUI.interval_add('motor_and_status_pull', get_status, 50, true);
|
|
||||||
} else {
|
|
||||||
document.removeEventListener('keydown', e => disableMotorTest(e));
|
|
||||||
GUI.interval_remove("motor_and_status_pull");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setContentButtons(enabled);
|
setContentButtons(enabled);
|
||||||
|
@ -1002,7 +996,7 @@ motors.initialize = async function (callback) {
|
||||||
|
|
||||||
// data pulling functions used inside interval timer
|
// data pulling functions used inside interval timer
|
||||||
|
|
||||||
function get_status() {
|
function getStatus() {
|
||||||
// status needed for arming flag
|
// status needed for arming flag
|
||||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, get_motor_data);
|
MSP.send_message(MSPCodes.MSP_STATUS, false, false, get_motor_data);
|
||||||
}
|
}
|
||||||
|
@ -1143,8 +1137,8 @@ motors.initialize = async function (callback) {
|
||||||
|
|
||||||
$('a.stop').on('click', () => motorsEnableTestModeElement.prop('checked', false).trigger('change'));
|
$('a.stop').on('click', () => motorsEnableTestModeElement.prop('checked', false).trigger('change'));
|
||||||
|
|
||||||
// get initial motor status values
|
// enable Status and Motor data pulling
|
||||||
get_status();
|
GUI.interval_add('motor_and_status_pull', getStatus, 50, true);
|
||||||
|
|
||||||
setup_motor_output_reordering_dialog(SetupEscDshotDirectionDialogCallback, zeroThrottleValue);
|
setup_motor_output_reordering_dialog(SetupEscDshotDirectionDialogCallback, zeroThrottleValue);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue