Skip to content

Commit 876233a

Browse files
fs: Use board ID 9901 instead of 9900.
Until the apps have been updated, then we can follow the spec again and use 9900.
1 parent 5f20083 commit 876233a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

js/fs.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

js/python-main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function translations(baseLanguage) {
307307
var endsWithURL = new RegExp(newLangURL + "$");
308308
if (endsWithURL.test(document.getElementById(elementId).src)) {
309309
// The request newLang is the current one, don't reload js file
310-
return successCallback();
310+
return successCallback(_extendedLang);
311311
}
312312
// Check for a valid language
313313
if (validLangs.indexOf(newLang) >- 1) {

0 commit comments

Comments
 (0)