File tree Expand file tree Collapse file tree 8 files changed +29
-23
lines changed Expand file tree Collapse file tree 8 files changed +29
-23
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,9 @@ class USBWorkflow extends Workflow {
236
236
// Workflow specific Functions
237
237
async _switchToDevice ( device ) {
238
238
device . addEventListener ( "message" , this . onSerialReceive . bind ( this ) ) ;
239
+ device . addEventListener ( "disconnect" , async ( e ) => {
240
+ await this . onDisconnected ( e , false ) ;
241
+ } ) ;
239
242
240
243
this . _serialDevice = device ;
241
244
console . log ( "switch to" , this . _serialDevice ) ;
@@ -253,13 +256,13 @@ class USBWorkflow extends Workflow {
253
256
await this . writer . ready ;
254
257
}
255
258
256
- await this . showBusy ( this . _getDeviceUid ( ) ) ;
257
-
258
259
this . updateConnected ( CONNSTATE . connected ) ;
259
260
260
261
// At this point we should see if we should init the file client and check if have a saved dir handle
261
262
let fileops = new FileOps ( this . repl , false ) ;
262
263
if ( await fileops . isReadOnly ( ) ) {
264
+ // UID Only needed for matching the CIRCUITPY drive with the Serial Terminal
265
+ await this . showBusy ( this . _getDeviceUid ( ) ) ;
263
266
let modal = this . connectDialog . getModal ( ) ;
264
267
265
268
// Show the last step
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ class Workflow {
66
66
this . _showSerial = params . showSerialFunc ;
67
67
68
68
this . repl . setTitle = this . setTerminalTitle . bind ( this ) ;
69
+ this . repl . writeToTerminal = this . writeToTerminal . bind ( this ) ;
69
70
this . repl . serialTransmit = this . serialTransmit . bind ( this ) ;
70
71
}
71
72
@@ -115,7 +116,7 @@ class Workflow {
115
116
}
116
117
117
118
async onSerialReceive ( e ) {
118
- this . writeToTerminal ( await this . repl . onSerialReceive ( e ) ) ;
119
+ await this . repl . onSerialReceive ( e ) ;
119
120
}
120
121
121
122
connectionStatus ( partialConnectionsAllowed = false ) {
Original file line number Diff line number Diff line change 14
14
},
15
15
"dependencies" : {
16
16
"@adafruit/ble-file-transfer-js" : " adafruit/ble-file-transfer-js#1.0.2" ,
17
- "@adafruit/circuitpython-repl-js" : " adafruit/circuitpython-repl-js#2.1.1 " ,
17
+ "@adafruit/circuitpython-repl-js" : " adafruit/circuitpython-repl-js#3.0.0 " ,
18
18
"@codemirror/lang-python" : " ^6.1.6" ,
19
19
"@fortawesome/fontawesome-free" : " ^6.5.2" ,
20
20
"@xterm/addon-fit" : " ^0.10.0" ,
Original file line number Diff line number Diff line change 48
48
border : none ;
49
49
background-color : $purple ;
50
50
margin : 10px 0 10px 10px ;
51
+ cursor : pointer ;
52
+ white-space : nowrap ;
51
53
52
54
i {
53
55
padding-left : 10px ;
54
56
}
55
57
56
- cursor : pointer ;
57
- white-space : nowrap ;
58
-
59
58
& :first-of-type , & .first-item {
60
59
margin-left : 0 ;
61
60
}
Original file line number Diff line number Diff line change 35
35
counter-increment : step;
36
36
37
37
.step-number {
38
- & ::before {
39
- content : counter (step );
40
- }
41
38
width : 75px ;
42
39
height : 75px ;
43
40
color : #333 ;
49
46
border : solid 5px #333 ;
50
47
border-radius : 100% ;
51
48
min-width : 75px ;
49
+
50
+ & ::before {
51
+ content : counter (step );
52
+ }
52
53
}
53
54
54
55
& .hidden {
59
60
60
61
@media (max-width : $screen-xs-max ) {
61
62
.connection-layout {
63
+ max-height : calc (100vh - 100px );
64
+ padding : 20px ;
65
+
62
66
.step {
63
67
.step-number {
64
68
width : 50px ;
68
72
min-width : 50px ;
69
73
}
70
74
}
71
-
72
- max-height : calc (100vh - 100px );
73
- padding : 20px ;
74
75
}
75
76
}
Original file line number Diff line number Diff line change 101
101
102
102
button {
103
103
@include rounded-button ;
104
- background-color : transparent ;
105
- margin : 0 ;
104
+ & {
105
+ background-color : transparent ;
106
+ margin : 0 ;
107
+ }
106
108
}
107
109
}
108
110
Original file line number Diff line number Diff line change 355
355
border : 1px solid #888 ;
356
356
357
357
a {
358
+ padding-left : 5px ;
359
+ display : grid ;
360
+ grid-template-columns : 30px minmax (60px , 1fr ) 60px 1fr ;
361
+ grid-gap : 10px ;
362
+ cursor : default ;
363
+
358
364
& .hidden-file {
359
365
360
366
i ,
363
369
}
364
370
}
365
371
366
- padding-left : 5px ;
367
- display : grid ;
368
- grid-template-columns : 30px minmax (60px , 1fr ) 60px 1fr ;
369
- grid-gap : 10px ;
370
- cursor : default ;
371
-
372
372
& .selected {
373
373
background-color : $light-purple ;
374
374
}
You can’t perform that action at this time.
0 commit comments