Skip to content

Commit 94d2994

Browse files
committed
Fix for updating beta version of MP
We currently need MP 1.25.0 that is not released so the version number is not updated. This will look for version beta06. If it is not found then it will update even if the version number is correct.
1 parent b20f68f commit 94d2994

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

js/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ import { configNonBeta } from './nonbetaConfig.js';
99

1010
const showChangelogVersion = "1.2.1"; //update all instances of ?version= in the index file to match the version. This is needed for local cache busting
1111
window.latestMicroPythonVersion = [1, 25, 0];
12+
13+
// this is needed because version 1.25.0 is not released yet and so the version number is not changing. Some boards
14+
// got shipped with a version before this beta06. So this will help.
15+
window.latestMicroPythonVersionPlus = "beta06"
16+
//Set to true if latestMicroPythonVersionPlus is empty.
17+
window.MPVersionPlus = false;
18+
1219
window.xrpID = "";
1320

1421

@@ -751,7 +758,7 @@ function registerShell(_container, state){
751758
return;
752759
}
753760
}
754-
var message = "The MicroPython on your XRP needs to be updated. The new version is " + window.latestMicroPythonVersion[0] + "." + window.latestMicroPythonVersion[1] + "." + window.latestMicroPythonVersion[2];
761+
var message = "The MicroPython on your XRP needs to be updated. The new version is " + window.latestMicroPythonVersion[0] + "." + window.latestMicroPythonVersion[1] + "." + window.latestMicroPythonVersion[2] + " " + window.latestMicroPythonVersionPlus;
755762
if(REPL.BLE_DEVICE != undefined){
756763
message += "<br>You will need to connect your XRP with a USB cable in order to update MicroPython";
757764
await alertMessage(message);

js/repl.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,8 @@ class ReplJS{
11701170
" break\n" +
11711171
"except:\n" +
11721172
" print(\"ERROR EX\")\n" +
1173-
"print(''.join(['{:02x}'.format(b) for b in machine.unique_id()]));";
1173+
"print(''.join(['{:02x}'.format(b) for b in machine.unique_id()]))\n" +
1174+
"print(sys.version)";
11741175

11751176

11761177
var hiddenLines = await this.writeUtilityCmdRaw(cmd, true, 1);
@@ -1188,7 +1189,17 @@ class ReplJS{
11881189
} else if (hiddenLines[1].includes('RP2040')) {
11891190
this.PROCESSOR = 2040;
11901191
}
1191-
1192+
1193+
if(window.latestMicroPythonVersionPlus != ""){
1194+
if(hiddenLines[4].includes(window.latestMicroPythonVersionPlus)){
1195+
window.MPversionPlus = true;
1196+
}
1197+
else{
1198+
window.MPversionPlus = false;
1199+
}
1200+
}
1201+
1202+
11921203
return [hiddenLines[0].substring(2), hiddenLines[2], hiddenLines[3]];
11931204
}else{
11941205
console.error("Error getting version information");
@@ -1388,7 +1399,7 @@ class ReplJS{
13881399

13891400
info[0]= info[0].replace(/[\(\)]/g, "").replace(/,\s/g, "."); //convert to a semantic version
13901401
//if the microPython is out of date
1391-
if(this.isVersionNewer(window.latestMicroPythonVersion, info[0])){
1402+
if(this.isVersionNewer(window.latestMicroPythonVersion, info[0]) || window.MPversionPlus == false){
13921403
// Need to update MicroPython
13931404
//alert("Need to update Micropython")
13941405
await this.showMicropythonUpdate();

0 commit comments

Comments
 (0)