File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ const REBOOT_CONNECT_MAX_TIME_MS = 10000;
39
39
const REBOOT_GRACE_PERIOD_MS = 2000 ;
40
40
let rebootTimestamp = 0 ;
41
41
42
+ function isCliOnlyMode ( ) {
43
+ return getConfig ( "cliOnlyMode" ) ?. cliOnlyMode === true ;
44
+ }
45
+
42
46
const toggleStatus = function ( ) {
43
47
isConnected = ! isConnected ;
44
48
} ;
@@ -61,6 +65,7 @@ export function initializeSerialBackend() {
61
65
! GUI . connecting_to &&
62
66
! [ "cli" , "firmware_flasher" ] . includes ( GUI . active_tab ) &&
63
67
PortHandler . portPicker . autoConnect &&
68
+ ! isCliOnlyMode ( ) &&
64
69
Date . now ( ) - rebootTimestamp <= REBOOT_CONNECT_MAX_TIME_MS
65
70
) {
66
71
connectDisconnect ( ) ;
@@ -588,7 +593,7 @@ function setRtc() {
588
593
function finishOpen ( ) {
589
594
CONFIGURATOR . connectionValid = true ;
590
595
591
- if ( getConfig ( "cliOnlyMode" ) ?. cliOnlyMode ) {
596
+ if ( isCliOnlyMode ( ) ) {
592
597
connectCli ( ) ;
593
598
return ;
594
599
}
@@ -658,10 +663,7 @@ function onConnect() {
658
663
} )
659
664
. show ( ) ;
660
665
661
- const isCliOnlyMode =
662
- getConfig ( "cliOnlyMode" ) ?. cliOnlyMode && GUI . allowedTabs . length === 1 && GUI . allowedTabs [ 0 ] === "cli" ;
663
-
664
- if ( FC . CONFIG . flightControllerVersion !== "" && ! isCliOnlyMode ) {
666
+ if ( FC . CONFIG . flightControllerVersion !== "" && ! isCliOnlyMode ( ) ) {
665
667
FC . FEATURE_CONFIG . features = new Features ( FC . CONFIG ) ;
666
668
FC . BEEPER_CONFIG . beepers = new Beepers ( FC . CONFIG ) ;
667
669
FC . BEEPER_CONFIG . dshotBeaconConditions = new Beepers ( FC . CONFIG , [ "RX_LOST" , "RX_SET" ] ) ;
You can’t perform that action at this time.
0 commit comments