@@ -63,7 +63,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
6363
6464 function esc_protocol ( ) {
6565 var next_callback = load_sensor_alignment ;
66- if ( semver . gte ( CONFIG . apiVersion , "1.16.0 " ) ) {
66+ if ( CONFIG . flightControllerIdentifier == "BTFL" && semver . gte ( CONFIG . flightControllerVersion , "2.8.1 " ) ) {
6767 MSP . send_message ( MSP_codes . MSP_PID_ADVANCED_CONFIG , false , false , next_callback ) ;
6868 } else {
6969 next_callback ( ) ;
@@ -94,17 +94,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
9494 }
9595
9696 MSP . send_message ( MSP_codes . MSP_IDENT , false , false , load_config ) ;
97-
98- function recalculate_cycles_sec ( ) {
99- var looptime = $ ( 'input[name="looptime"]' ) . val ( ) ;
100-
101- var message = 'Max' ;
102- if ( looptime > 0 ) {
103- message = parseFloat ( ( 1 / looptime ) * 1000 * 1000 ) . toFixed ( 0 ) ;
104- }
105-
106- $ ( 'input[name="looptimehz"]' ) . val ( message ) ;
107- }
10897
10998 function process_html ( ) {
11099
@@ -354,8 +343,13 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
354343 $ ( 'select.pidProcessDenom option[value="' + ( i + 1 ) + '"]' ) . text ( ( pidF / 100 ) . toString ( ) + 'KHz' ) ; }
355344
356345 } ) ;
357-
358-
346+
347+ if ( CONFIG . flightControllerIdentifier == "BTFL" && semver . lt ( CONFIG . flightControllerVersion , "2.8.1" ) ) {
348+ $ ( '.selectProtocol' ) . hide ( ) ;
349+ $ ( '.checkboxPwm' ) . hide ( ) ;
350+ $ ( '.selectPidProcessDenom' ) . hide ( ) ;
351+ }
352+
359353 // generate GPS
360354 var gpsProtocols = [
361355 'NMEA' ,
@@ -472,12 +466,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
472466 $ ( 'div.disarmdelay' ) . show ( ) ;
473467 else
474468 $ ( 'div.disarmdelay' ) . hide ( ) ;
475-
476- // fill FC loop time
477- $ ( 'input[name="looptime"]' ) . val ( FC_CONFIG . loopTime ) ;
478469
479- recalculate_cycles_sec ( ) ;
480-
481470 $ ( 'div.cycles' ) . show ( ) ;
482471 }
483472
@@ -512,11 +501,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
512501 }
513502 }
514503
515- // UI hooks
516- $ ( 'input[name="looptime"]' ) . change ( function ( ) {
517- recalculate_cycles_sec ( ) ;
518- } ) ;
519-
520504 $ ( 'input[type="checkbox"].feature' , features_e ) . change ( function ( ) {
521505 var element = $ ( this ) ,
522506 index = element . data ( 'bit' ) ,
@@ -579,7 +563,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
579563 if ( semver . gte ( CONFIG . apiVersion , "1.8.0" ) ) {
580564 ARMING_CONFIG . auto_disarm_delay = parseInt ( $ ( 'input[name="autodisarmdelay"]' ) . val ( ) ) ;
581565 ARMING_CONFIG . disarm_kill_switch = ~ ~ $ ( 'input[name="disarmkillswitch"]' ) . is ( ':checked' ) ; // ~~ boolean to decimal conversion
582- FC_CONFIG . loopTime = parseInt ( $ ( 'input[name="looptime"]' ) . val ( ) ) ;
583566 }
584567
585568 MISC . minthrottle = parseInt ( $ ( 'input[name="minthrottle"]' ) . val ( ) ) ;
@@ -645,7 +628,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
645628 }
646629 function save_esc_protocol ( ) {
647630 var next_callback = save_acc_trim ;
648- if ( semver . gte ( CONFIG . apiVersion , "1.16.0 " ) ) {
631+ if ( CONFIG . flightControllerIdentifier == "BTFL" && semver . gte ( CONFIG . flightControllerVersion , "2.8.1 " ) ) {
649632 MSP . send_message ( MSP_codes . MSP_SET_PID_ADVANCED_CONFIG , MSP . crunch ( MSP_codes . MSP_SET_PID_ADVANCED_CONFIG ) , false , next_callback ) ;
650633 } else {
651634 next_callback ( ) ;
@@ -658,7 +641,17 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
658641 }
659642
660643 function save_arming_config ( ) {
661- MSP . send_message ( MSP_codes . MSP_SET_ARMING_CONFIG , MSP . crunch ( MSP_codes . MSP_SET_ARMING_CONFIG ) , false , save_to_eeprom ) ;
644+ MSP . send_message ( MSP_codes . MSP_SET_ARMING_CONFIG , MSP . crunch ( MSP_codes . MSP_SET_ARMING_CONFIG ) , false , save_looptime_config ) ;
645+ }
646+
647+ function save_looptime_config ( ) {
648+ var next_callback = save_to_eeprom ;
649+ if ( CONFIG . flightControllerIdentifier == "BTFL" && semver . lt ( CONFIG . flightControllerVersion , "2.8.1" ) ) {
650+ FC_CONFIG . loopTime = PID_ADVANCED_CONFIG . gyro_sync_denom * 125 ;
651+ MSP . send_message ( MSP_codes . MSP_SET_LOOP_TIME , MSP . crunch ( MSP_codes . MSP_SET_LOOP_TIME ) , false , next_callback ) ;
652+ } else {
653+ next_callback ( ) ;
654+ }
662655 }
663656
664657 function save_to_eeprom ( ) {
0 commit comments