@@ -19,6 +19,7 @@ var microbitFsWrapper = function() {
1919 'exists' ,
2020 'getStorageRemaining' ,
2121 'getStorageSize' ,
22+ 'getStorageUsed' ,
2223 'getUniversalHex' ,
2324 'ls' ,
2425 'read' ,
@@ -63,8 +64,9 @@ var microbitFsWrapper = function() {
6364 if ( ! uPyV1 || ! uPyV2 ) {
6465 console . error ( 'There was an issue loading the MicroPython Hex files.' ) ;
6566 }
67+ // TODO: We need to use ID 9901 for app compatibility, but can soon be changed to 9900 (as per spec)
6668 uPyFs = new microbitFs . MicropythonFsHex ( [
67- { hex : uPyV1 , boardId : 0x9900 } ,
69+ { hex : uPyV1 , boardId : 0x9901 } ,
6870 { hex : uPyV2 , boardId : 0x9903 } ,
6971 ] , {
7072 'maxFsSize' : commonFsSize ,
@@ -79,7 +81,7 @@ var microbitFsWrapper = function() {
7981 */
8082 fsWrapper . getBytesForBoardId = function ( boardId ) {
8183 if ( boardId == '9900' || boardId == '9901' ) {
82- return uPyFs . getIntelHexBytes ( 0x9900 ) ;
84+ return uPyFs . getIntelHexBytes ( 0x9901 ) ;
8385 } else if ( boardId == '9903' || boardId == '9904' ) {
8486 return uPyFs . getIntelHexBytes ( 0x9903 ) ;
8587 } else {
@@ -93,15 +95,15 @@ var microbitFsWrapper = function() {
9395 */
9496 fsWrapper . getIntelHexForBoardId = function ( boardId ) {
9597 if ( boardId == '9900' || boardId == '9901' ) {
96- var hexStr = uPyFs . getIntelHex ( 0x9900 ) ;
98+ var hexStr = uPyFs . getIntelHex ( 0x9901 ) ;
9799 } else if ( boardId == '9903' || boardId == '9904' ) {
98100 var hexStr = uPyFs . getIntelHex ( 0x9903 ) ;
99101 } else {
100102 throw Error ( 'Could not recognise the Board ID ' + boardId ) ;
101103 }
102104 // iHex is ASCII so we can do a 1-to-1 conversion from chars to bytes
103105 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 ++ ) {
105107 hexBuffer [ i ] = hexStr . charCodeAt ( i ) ;
106108 }
107109 return hexBuffer . buffer ;
0 commit comments