@@ -61,7 +61,7 @@ export function initializeSerialBackend() {
61
61
! GUI . connecting_to &&
62
62
GUI . active_tab !== "firmware_flasher" &&
63
63
( ( PortHandler . portPicker . autoConnect && ! [ "manual" , "virtual" ] . includes ( device ) ) ||
64
- Date . now ( ) - rebootTimestamp > REBOOT_CONNECT_MAX_TIME_MS )
64
+ Date . now ( ) - rebootTimestamp < REBOOT_CONNECT_MAX_TIME_MS )
65
65
) {
66
66
connectDisconnect ( ) ;
67
67
}
@@ -73,7 +73,7 @@ export function initializeSerialBackend() {
73
73
! GUI . connecting_to &&
74
74
GUI . active_tab !== "firmware_flasher" &&
75
75
( ( PortHandler . portPicker . autoConnect && ! [ "manual" , "virtual" ] . includes ( device ) ) ||
76
- Date . now ( ) - rebootTimestamp > REBOOT_CONNECT_MAX_TIME_MS )
76
+ Date . now ( ) - rebootTimestamp < REBOOT_CONNECT_MAX_TIME_MS )
77
77
) {
78
78
connectDisconnect ( ) ;
79
79
}
@@ -812,15 +812,9 @@ export function reinitializeConnection() {
812
812
if ( CONFIGURATOR . virtualMode ) {
813
813
connectDisconnect ( ) ;
814
814
if ( PortHandler . portPicker . autoConnect ) {
815
- < << << << HEAD
816
815
return setTimeout ( function ( ) {
817
816
$ ( "a.connection_button__link" ) . trigger ( "click" ) ;
818
817
} , 500 ) ;
819
- = === ===
820
- clickConnectDisconnect ( ) ;
821
- } else {
822
- return connectDisconnect ( ) ;
823
- > >>> >>> d8b258f5 ( Update autoconnect )
824
818
}
825
819
}
826
820
@@ -832,20 +826,11 @@ export function reinitializeConnection() {
832
826
// Send reboot command to the flight controller
833
827
MSP . send_message ( MSPCodes . MSP_SET_REBOOT , false , false ) ;
834
828
835
- < << << << HEAD
836
829
if ( currentPort . startsWith ( "bluetooth" ) ) {
837
830
if ( ! PortHandler . portPicker . autoConnect ) {
838
831
return setTimeout ( function ( ) {
839
832
$ ( "a.connection_button__link" ) . trigger ( "click" ) ;
840
833
} , 1500 ) ;
841
- = === ===
842
- if ( CONFIGURATOR . bluetoothMode ) {
843
- if ( PortHandler . portPicker . autoConnect ) {
844
- // Bluetooth devices are not disconnected when rebooting
845
- } else {
846
- // Disconnect from the device
847
- clickConnectDisconnect ( ) ;
848
- > >>> >>> d8b258f5 ( Update autoconnect )
849
834
}
850
835
}
851
836
@@ -904,13 +889,6 @@ function showRebootDialog() {
904
889
}
905
890
} , 100 ) ;
906
891
907
- const timeout = ! CONFIGURATOR . bluetoothMode && ! CONFIGURATOR . virtualMode && ! CONFIGURATOR . manualMode ? 5000 : 1500 ;
908
-
909
- // Set a maximum timeout for the reboot process (5 seconds)
910
- setTimeout ( function ( ) {
911
- executeCallbackOnce ( ) ;
912
- } , timeout ) ;
913
-
914
892
// Helper function to create the reboot dialog if it doesn't exist
915
893
function createRebootProgressDialog ( ) {
916
894
const dialog = document . createElement ( "dialog" ) ;
0 commit comments