File tree Expand file tree Collapse file tree 4 files changed +80
-1
lines changed
Expand file tree Collapse file tree 4 files changed +80
-1
lines changed Original file line number Diff line number Diff line change 1+ name : build-docs
2+ on :
3+ release :
4+ types : [created]
5+ push :
6+ branches :
7+ - main
8+ tags :
9+ - " **"
10+ jobs :
11+ build :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout
15+ uses : actions/checkout@v4
16+ - name : Setup Pages
17+ uses : actions/configure-pages@v5
18+ - run : npm ci
19+ - name : Build docs
20+ run : npm run docs
21+ - name : Upload artifact
22+ uses : actions/upload-pages-artifact@v3
23+ with :
24+ path : ./docs/build
25+
26+ deploy :
27+ permissions :
28+ pages : write
29+ id-token : write
30+ environment :
31+ name : github-pages
32+ url : ${{ steps.deployment.outputs.page_url }}
33+ runs-on : ubuntu-latest
34+ needs : build
35+ steps :
36+ - name : Deploy to GitHub Pages
37+ id : deployment
38+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 3838 "vitest" : " ^2.0.0"
3939 },
4040 "dependencies" : {
41+ "@microbit/microbit-fs" : " ^0.9.2" ,
4142 "@microbit/microbit-universal-hex" : " ^0.2.2" ,
4243 "@types/web-bluetooth" : " ^0.0.20" ,
4344 "crelt" : " ^1.0.6" ,
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ import { MicrobitWebUSBConnection } from "../lib/usb";
2020import { MicrobitRadioBridgeConnection } from "../lib/usb-radio-bridge" ;
2121import "./demo.css" ;
2222import { MagnetometerDataEvent } from "../lib/magnetometer" ;
23+ import { MicropythonFsHex } from "@microbit/microbit-fs" ;
24+ import { BoardId } from "../lib/board-id" ;
2325
2426type ConnectionType = "usb" | "bluetooth" | "radio" ;
2527
@@ -209,9 +211,15 @@ const createFlashSection = (): Section => {
209211 const file = ( e . currentTarget as HTMLInputElement ) . files ?. item ( 0 ) ;
210212 if ( file ) {
211213 const text = await file . text ( ) ;
214+ const boardId = BoardId . forVersion ( "V1" ) . id ;
215+ console . log ( boardId ) ;
216+ const micropythonFs = new MicropythonFsHex ( [
217+ { hex : text , boardId } ,
218+ ] ) ;
212219 if ( connection . flash ) {
213220 console . time ( "flash" ) ;
214- await connection . flash ( createUniversalHexFlashDataSource ( text ) , {
221+ const hex = micropythonFs . getIntelHex ( boardId ) ;
222+ await connection . flash ( async ( ) => hex , {
215223 partial : true ,
216224 progress : ( percentage : number | undefined ) => {
217225 console . log ( percentage ) ;
You can’t perform that action at this time.
0 commit comments