File tree 2 files changed +21
-7
lines changed
2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ button.small .icon {
131
131
132
132
# tabs {
133
133
display : flex;
134
- padding : 10px 10px 0px 40 px ;
134
+ padding : 10px 10px 0px 60 px ;
135
135
align-items : center;
136
136
gap : 10px ;
137
137
align-self : stretch;
@@ -231,7 +231,7 @@ button.small .icon {
231
231
# code-editor .cm-gutters {
232
232
background-color : # ECF1F1 ;
233
233
border-right : none;
234
- width : 40 px ;
234
+ width : 60 px ;
235
235
font-size : 14px ;
236
236
}
237
237
Original file line number Diff line number Diff line change @@ -122,14 +122,28 @@ async function store(state, emitter) {
122
122
state . isConnecting = true
123
123
emitter . emit ( 'render' )
124
124
125
- let timeout_id = setTimeout ( ( ) => emitter . emit ( 'connection-timeout' ) , 5000 )
126
- await serial . connect ( path )
127
- clearTimeout ( timeout_id )
128
-
125
+ // The following Timeout operation will be cleared after a succesful getPrompt()
126
+ // If a board has crashed and/or cannot return a REPL prompt, the connection will fail
127
+ // and the user will be prompted to reset the device and try again.
128
+ let timeout_id = setTimeout ( ( ) => {
129
+ let response = win . openDialog ( {
130
+ type : 'question' ,
131
+ buttons : [ 'OK' ] ,
132
+ cancelId : 0 ,
133
+ message : "Could not connect to the board. Reset it and try again."
134
+ } )
135
+ console . log ( 'Reset request acknowledged' , response )
136
+ emitter . emit ( 'connection-timeout' )
137
+ } , 3500 )
138
+ try {
139
+ await serial . connect ( path )
140
+ } catch ( e ) {
141
+ console . error ( e )
142
+ }
129
143
// Stop whatever is going on
130
144
// Recover from getting stuck in raw repl
131
145
await serial . getPrompt ( )
132
-
146
+ clearTimeout ( timeout_id )
133
147
// Connected and ready
134
148
state . isConnecting = false
135
149
state . isConnected = true
You can’t perform that action at this time.
0 commit comments