File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -313,10 +313,11 @@ class MicrobitWebUSBConnectionImpl
313313 this . visibilityReconnect = true ;
314314 } else {
315315 if ( this . addedListeners . serialdata ) {
316- this . log ( "Reinstating serial after flash" ) ;
317- if ( this . connection . daplink ) {
318- await this . connection . daplink . connect ( ) ;
319- await this . startSerialInternal ( ) ;
316+ this . log ( "Reinstating serial after flash" ) ;
317+ if ( this . connection . daplink ) {
318+ await this . connection . daplink . connect ( ) ;
319+ await this . startSerialInternal ( ) ;
320+ }
320321 }
321322 }
322323 }
@@ -482,10 +483,12 @@ class MicrobitWebUSBConnectionImpl
482483 protected eventActivated ( type : string ) : void {
483484 switch ( type as keyof SerialConnectionEventMap ) {
484485 case "serialdata" : {
486+ // Prevent starting serial when flashing.
485487 if ( ! this . flashing ) {
486488 this . startSerialInternal ( ) ;
487- this . addedListeners . serialdata = 1 ;
488489 }
490+ // Allows for reinstating serial after flashing.
491+ this . addedListeners . serialdata = 1 ;
489492 break ;
490493 }
491494 }
You can’t perform that action at this time.
0 commit comments