1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

new generic crunching mechanism that will be used with all of the future set messages

This commit is contained in:
cTn 2014-09-16 19:24:10 +02:00
parent c37b9ff0f1
commit 8a951acb82

View file

@ -570,4 +570,30 @@ MSP.send_message = function(code, data, callback_sent, callback_msp) {
}); });
return true; return true;
} };
MSP.crunch = function (name) {
var buffer = [];
switch (name) {
case 'BF_CONFIG':
buffer.push(BF_CONFIG.mixerConfiguration);
buffer.push(specificByte(BF_CONFIG.features, 0));
buffer.push(specificByte(BF_CONFIG.features, 1));
buffer.push(specificByte(BF_CONFIG.features, 2));
buffer.push(specificByte(BF_CONFIG.features, 3));
buffer.push(BF_CONFIG.serialrx_type);
buffer.push(specificByte(BF_CONFIG.board_align_roll, 0));
buffer.push(specificByte(BF_CONFIG.board_align_roll, 1));
buffer.push(specificByte(BF_CONFIG.board_align_pitch, 0));
buffer.push(specificByte(BF_CONFIG.board_align_pitch, 1));
buffer.push(specificByte(BF_CONFIG.board_align_yaw, 0));
buffer.push(specificByte(BF_CONFIG.board_align_yaw, 1));
break;
default:
return false;
}
return buffer;
};