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 ( ) ;
@@ -562,7 +567,7 @@ function setRtc() {
562
567
function finishOpen ( ) {
563
568
CONFIGURATOR . connectionValid = true ;
564
569
565
- if ( getConfig ( "cliOnlyMode" ) ?. cliOnlyMode ) {
570
+ if ( isCliOnlyMode ( ) ) {
566
571
connectCli ( ) ;
567
572
return ;
568
573
}
@@ -632,10 +637,7 @@ function onConnect() {
632
637
} )
633
638
. show ( ) ;
634
639
635
- const isCliOnlyMode =
636
- getConfig ( "cliOnlyMode" ) ?. cliOnlyMode && GUI . allowedTabs . length === 1 && GUI . allowedTabs [ 0 ] === "cli" ;
637
-
638
- if ( FC . CONFIG . flightControllerVersion !== "" && ! isCliOnlyMode ) {
640
+ if ( FC . CONFIG . flightControllerVersion !== "" && ! isCliOnlyMode ( ) ) {
639
641
FC . FEATURE_CONFIG . features = new Features ( FC . CONFIG ) ;
640
642
FC . BEEPER_CONFIG . beepers = new Beepers ( FC . CONFIG ) ;
641
643
FC . BEEPER_CONFIG . dshotBeaconConditions = new Beepers ( FC . CONFIG , [ "RX_LOST" , "RX_SET" ] ) ;
You can’t perform that action at this time.
0 commit comments