From 9de5cdcf84a4505aaceedbef1bfb0a62fbc09b0e Mon Sep 17 00:00:00 2001 From: cTn Date: Mon, 3 Feb 2014 09:28:10 +0100 Subject: [PATCH] extra failsafe to trigger while leaving motor tab --- js/gui.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/gui.js b/js/gui.js index b02a2775c8..ee16f9a4db 100644 --- a/js/gui.js +++ b/js/gui.js @@ -212,6 +212,16 @@ GUI_control.prototype.tab_switch_cleanup = function(callback) { break; case 'motor_outputs': GUI.interval_remove('motor_poll'); + + // send data to mcu + var buffer_out = []; + + for (var i = 0; i < 8; i++) { + buffer_out.push(lowByte(MISC.minthrottle)); + buffer_out.push(highByte(MISC.minthrottle)); + } + + send_message(MSP_codes.MSP_SET_MOTOR, buffer_out); if (callback) callback(); break;