@@ -19,6 +19,7 @@ var microbitFsWrapper = function() {
19
19
'exists' ,
20
20
'getStorageRemaining' ,
21
21
'getStorageSize' ,
22
+ 'getStorageUsed' ,
22
23
'getUniversalHex' ,
23
24
'ls' ,
24
25
'read' ,
@@ -63,8 +64,9 @@ var microbitFsWrapper = function() {
63
64
if ( ! uPyV1 || ! uPyV2 ) {
64
65
console . error ( 'There was an issue loading the MicroPython Hex files.' ) ;
65
66
}
67
+ // TODO: We need to use ID 9901 for app compatibility, but can soon be changed to 9900 (as per spec)
66
68
uPyFs = new microbitFs . MicropythonFsHex ( [
67
- { hex : uPyV1 , boardId : 0x9900 } ,
69
+ { hex : uPyV1 , boardId : 0x9901 } ,
68
70
{ hex : uPyV2 , boardId : 0x9903 } ,
69
71
] , {
70
72
'maxFsSize' : commonFsSize ,
@@ -79,7 +81,7 @@ var microbitFsWrapper = function() {
79
81
*/
80
82
fsWrapper . getBytesForBoardId = function ( boardId ) {
81
83
if ( boardId == '9900' || boardId == '9901' ) {
82
- return uPyFs . getIntelHexBytes ( 0x9900 ) ;
84
+ return uPyFs . getIntelHexBytes ( 0x9901 ) ;
83
85
} else if ( boardId == '9903' || boardId == '9904' ) {
84
86
return uPyFs . getIntelHexBytes ( 0x9903 ) ;
85
87
} else {
@@ -93,15 +95,15 @@ var microbitFsWrapper = function() {
93
95
*/
94
96
fsWrapper . getIntelHexForBoardId = function ( boardId ) {
95
97
if ( boardId == '9900' || boardId == '9901' ) {
96
- var hexStr = uPyFs . getIntelHex ( 0x9900 ) ;
98
+ var hexStr = uPyFs . getIntelHex ( 0x9901 ) ;
97
99
} else if ( boardId == '9903' || boardId == '9904' ) {
98
100
var hexStr = uPyFs . getIntelHex ( 0x9903 ) ;
99
101
} else {
100
102
throw Error ( 'Could not recognise the Board ID ' + boardId ) ;
101
103
}
102
104
// iHex is ASCII so we can do a 1-to-1 conversion from chars to bytes
103
105
var hexBuffer = new Uint8Array ( hexStr . length ) ;
104
- for ( var i = 0 , strLen = hexStr . length ; i < strLen ; i ++ ) {
106
+ for ( var i = 0 , strLen = hexStr . length ; i < strLen ; i ++ ) {
105
107
hexBuffer [ i ] = hexStr . charCodeAt ( i ) ;
106
108
}
107
109
return hexBuffer . buffer ;
0 commit comments