File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,7 +172,6 @@ class DAPWrapper {
172172 this . reconnected = false ;
173173 this . flashing = true ;
174174 this . device = device ;
175- this . allocBoardID ( ) ;
176175 this . allocDAP ( ) ;
177176 }
178177
@@ -183,11 +182,6 @@ class DAPWrapper {
183182 }
184183 this . boardId = this . device . serialNumber . substring ( 0 , 4 ) ;
185184 PartialFlashingUtils . log ( "Detected board ID " + this . boardId ) ;
186- document . dispatchEvent ( new CustomEvent ( "webusb" , { detail : {
187- "flash-type" : "partial-flash" ,
188- "event-type" : "info" ,
189- "message" : "board-id/" + this . boardId ,
190- } } ) ) ;
191185 }
192186
193187 allocDAP ( ) {
@@ -209,7 +203,8 @@ class DAPWrapper {
209203 }
210204 return p
211205 . then ( ( ) => self . daplink . connect ( ) )
212- . then ( ( ) => self . cortexM . connect ( ) ) ;
206+ . then ( ( ) => self . cortexM . connect ( ) )
207+ . then ( ( ) => self . allocBoardID ( ) ) ;
213208 }
214209
215210 disconnectAsync ( ) {
Original file line number Diff line number Diff line change @@ -1245,6 +1245,11 @@ function web_editor(config) {
12451245 'event-type' : 'info' ,
12461246 'message' : 'connected'
12471247 } } ) ) ;
1248+ document . dispatchEvent ( new CustomEvent ( 'webusb' , { detail : {
1249+ 'flash-type' : 'webusb' ,
1250+ 'event-type' : 'info' ,
1251+ 'message' : 'board-id/' + window . dapwrapper . boardId ,
1252+ } } ) ) ;
12481253
12491254 // Update the Editor autocompletion MicroPython PI based on the board connected
12501255 var boardApi = microPythonApi . getCompatibleMicroPythonApi ( window . dapwrapper . boardId ) ;
You can’t perform that action at this time.
0 commit comments