mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
moving send_message routine to MSP object
This commit is contained in:
parent
46cf844e7e
commit
5abe7473f8
13 changed files with 85 additions and 85 deletions
|
@ -2,35 +2,35 @@ function configuration_backup() {
|
|||
// request configuration data (one by one)
|
||||
|
||||
function get_ident_data() {
|
||||
send_message(MSP_codes.MSP_IDENT, false, false, get_status_data);
|
||||
MSP.send_message(MSP_codes.MSP_IDENT, false, false, get_status_data);
|
||||
}
|
||||
|
||||
function get_status_data() {
|
||||
send_message(MSP_codes.MSP_STATUS, false, false, get_pid_data);
|
||||
MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_pid_data);
|
||||
}
|
||||
|
||||
function get_pid_data() {
|
||||
send_message(MSP_codes.MSP_PID, false, false, get_rc_tuning_data);
|
||||
MSP.send_message(MSP_codes.MSP_PID, false, false, get_rc_tuning_data);
|
||||
}
|
||||
|
||||
function get_rc_tuning_data() {
|
||||
send_message(MSP_codes.MSP_RC_TUNING, false, false, get_box_names_data);
|
||||
MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_box_names_data);
|
||||
}
|
||||
|
||||
function get_box_names_data() {
|
||||
send_message(MSP_codes.MSP_BOXNAMES, false, false, get_box_data);
|
||||
MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_box_data);
|
||||
}
|
||||
|
||||
function get_box_data() {
|
||||
send_message(MSP_codes.MSP_BOX, false, false, get_acc_trim_data);
|
||||
MSP.send_message(MSP_codes.MSP_BOX, false, false, get_acc_trim_data);
|
||||
}
|
||||
|
||||
function get_acc_trim_data() {
|
||||
send_message(MSP_codes.MSP_ACC_TRIM, false, false, get_misc_data);
|
||||
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, get_misc_data);
|
||||
}
|
||||
|
||||
function get_misc_data() {
|
||||
send_message(MSP_codes.MSP_MISC, false, false, backup);
|
||||
MSP.send_message(MSP_codes.MSP_MISC, false, false, backup);
|
||||
}
|
||||
|
||||
function backup() {
|
||||
|
@ -222,7 +222,7 @@ function configuration_upload() {
|
|||
}
|
||||
|
||||
// Send over the PID changes
|
||||
send_message(MSP_codes.MSP_SET_PID, PID_buffer_out, false, rc_tuning);
|
||||
MSP.send_message(MSP_codes.MSP_SET_PID, PID_buffer_out, false, rc_tuning);
|
||||
|
||||
function rc_tuning() {
|
||||
// RC Tuning section
|
||||
|
@ -236,7 +236,7 @@ function configuration_upload() {
|
|||
RC_tuning_buffer_out[6] = parseInt(RC_tuning.throttle_EXPO * 100);
|
||||
|
||||
// Send over the RC_tuning changes
|
||||
send_message(MSP_codes.MSP_SET_RC_TUNING, RC_tuning_buffer_out, false, aux);
|
||||
MSP.send_message(MSP_codes.MSP_SET_RC_TUNING, RC_tuning_buffer_out, false, aux);
|
||||
}
|
||||
|
||||
function aux() {
|
||||
|
@ -250,7 +250,7 @@ function configuration_upload() {
|
|||
}
|
||||
|
||||
// Send over the AUX changes
|
||||
send_message(MSP_codes.MSP_SET_BOX, AUX_val_buffer_out, false, trim);
|
||||
MSP.send_message(MSP_codes.MSP_SET_BOX, AUX_val_buffer_out, false, trim);
|
||||
}
|
||||
|
||||
// Trim section
|
||||
|
@ -262,7 +262,7 @@ function configuration_upload() {
|
|||
buffer_out[3] = highByte(CONFIG.accelerometerTrims[1]);
|
||||
|
||||
// Send over the new trims
|
||||
send_message(MSP_codes.MSP_SET_ACC_TRIM, buffer_out, false, misc);
|
||||
MSP.send_message(MSP_codes.MSP_SET_ACC_TRIM, buffer_out, false, misc);
|
||||
}
|
||||
|
||||
function misc() {
|
||||
|
@ -293,9 +293,9 @@ function configuration_upload() {
|
|||
buffer_out[21] = 0; // vbatlevel_crit (unused)
|
||||
|
||||
// Send ove the new MISC
|
||||
send_message(MSP_codes.MSP_SET_MISC, buffer_out, false, function() {
|
||||
MSP.send_message(MSP_codes.MSP_SET_MISC, buffer_out, false, function() {
|
||||
// Save changes to EEPROM
|
||||
send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, function() {
|
||||
MSP.send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, function() {
|
||||
GUI.log(chrome.i18n.getMessage('eeprom_saved_ok'));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue