PID controllers can now be reset to defaults

10.3.x-maintenance
NightHawk32 2015-12-12 18:42:49 -05:00
parent c738e23a85
commit 19e6f9026b
2 changed files with 9 additions and 0 deletions

View File

@ -71,6 +71,7 @@ var MSP_codes = {
MSP_SET_MOTOR: 214,
MSP_SET_3D: 217,
MSP_SET_RC_CONTROLS: 218,
MSP_SET_RESET_CURR_PID: 219,
// MSP_BIND: 240,
@ -859,6 +860,9 @@ var MSP = {
case MSP_codes.MSP_SET_ARMING_CONFIG:
console.log('Arming config saved');
break;
case MSP_codes.MSP_SET_RESET_CURR_PID:
console.log('Current PID profile reset');
break;
default:
console.log('Unknown code detected: ' + code);

View File

@ -276,6 +276,11 @@ TABS.pid_tuning.initialize = function (callback) {
}
});
$('#resetPIDs').on('click', function(){
MSP.send_message(MSP_codes.MSP_SET_RESET_CURR_PID, false, false, false);
updateActivatedTab();
});
$('.pid_tuning tr').each(function(){
for(i = 0; i < PID_names.length; i++) {
if($(this).hasClass(PID_names[i])) {