@@ -35,7 +35,11 @@ setup.initialize = function (callback) {
3535 }
3636
3737 function load_mixer_config ( ) {
38- MSP . send_message ( MSPCodes . MSP_MIXER_CONFIG , false , false , load_html ) ;
38+ MSP . send_message ( MSPCodes . MSP_MIXER_CONFIG , false , false , load_gyro_sensor ) ;
39+ }
40+
41+ function load_gyro_sensor ( ) {
42+ MSP . send_message ( MSPCodes . MSP_SENSOR_ALIGNMENT , false , false , load_html ) ;
3943 }
4044
4145 function load_html ( ) {
@@ -305,12 +309,25 @@ setup.initialize = function (callback) {
305309 }
306310
307311 MSP . send_message ( MSPCodes . MSP2_SENSOR_CONFIG_ACTIVE , false , false , function ( ) {
308- addSensorInfo (
309- FC . SENSOR_CONFIG_ACTIVE . gyro_hardware ,
310- sensor_gyro_e ,
311- "gyro" ,
312- sensorTypes ( ) . gyro . elements ,
313- ) ;
312+ if ( semver . gte ( FC . CONFIG . apiVersion , API_VERSION_1_47 ) ) {
313+ MSP . send_message ( MSPCodes . MSP2_GYRO_SENSOR , false , false , function ( ) {
314+ let gyroInfoList = [ ] ;
315+ for ( let i = 0 ; i < FC . GYRO_SENSOR . gyro_count ; i ++ ) {
316+ if ( ( FC . SENSOR_ALIGNMENT . gyro_enable_mask & ( 1 << i ) ) !== 0 ) {
317+ gyroInfoList . push ( sensorTypes ( ) . gyro . elements [ FC . GYRO_SENSOR . gyro_hardware [ i ] ] ) ;
318+ }
319+ }
320+ sensor_gyro_e . html ( gyroInfoList . join ( " " ) ) ;
321+ } ) ;
322+ } else {
323+ addSensorInfo (
324+ FC . SENSOR_CONFIG_ACTIVE . gyro_hardware ,
325+ sensor_gyro_e ,
326+ "gyro" ,
327+ sensorTypes ( ) . gyro . elements ,
328+ ) ;
329+ }
330+
314331 addSensorInfo ( FC . SENSOR_CONFIG_ACTIVE . acc_hardware , sensor_acc_e , "acc" , sensorTypes ( ) . acc . elements ) ;
315332 addSensorInfo (
316333 FC . SENSOR_CONFIG_ACTIVE . baro_hardware ,
0 commit comments