mirror of https://github.com/espruino/BangleApps
boot 0.65: Only display interpreter errors if log is nonzero
parent
242eda245b
commit
f7381a7d31
|
@ -75,3 +75,4 @@
|
||||||
0.64: Automatically create .widcache and .clkinfocache to speed up loads
|
0.64: Automatically create .widcache and .clkinfocache to speed up loads
|
||||||
Bangle.loadWidgets overwritten with fast version on success
|
Bangle.loadWidgets overwritten with fast version on success
|
||||||
Refuse to work on firmware <2v16 and remove old polyfills
|
Refuse to work on firmware <2v16 and remove old polyfills
|
||||||
|
0.65: Only display interpreter errors if log is nonzero
|
|
@ -66,12 +66,12 @@ if (s.ble===false) boot += `if (!NRF.getSecurityStatus().connected) NRF.sleep();
|
||||||
if (s.timeout!==undefined) boot += `Bangle.setLCDTimeout(${s.timeout});\n`;
|
if (s.timeout!==undefined) boot += `Bangle.setLCDTimeout(${s.timeout});\n`;
|
||||||
if (!s.timeout) boot += `Bangle.setLCDPower(1);\n`;
|
if (!s.timeout) boot += `Bangle.setLCDPower(1);\n`;
|
||||||
boot += `E.setTimeZone(${s.timezone});`;
|
boot += `E.setTimeZone(${s.timezone});`;
|
||||||
// Draw out of memory errors onto the screen
|
// Draw out of memory errors onto the screen if logging enabled
|
||||||
boot += `E.on('errorFlag', function(errorFlags) {
|
if (s.log) boot += `E.on('errorFlag', function(errorFlags) {
|
||||||
g.reset(1).setColor("#ff0000").setFont("6x8").setFontAlign(0,1).drawString(errorFlags,g.getWidth()/2,g.getHeight()-1).flip();
|
g.reset(1).setColor("#ff0000").setFont("6x8").setFontAlign(0,1).drawString(errorFlags,g.getWidth()/2,g.getHeight()-1).flip();
|
||||||
print("Interpreter error:", errorFlags);
|
print("Interpreter error:", errorFlags);
|
||||||
E.getErrorFlags(); // clear flags so we get called next time
|
E.getErrorFlags();
|
||||||
});\n`;
|
});\n`;// E.getErrorFlags() -> clear flags so we get called next time
|
||||||
// stop users doing bad things!
|
// stop users doing bad things!
|
||||||
if (global.save) boot += `global.save = function() { throw new Error("You can't use save() on Bangle.js without overwriting the bootloader!"); }\n`;
|
if (global.save) boot += `global.save = function() { throw new Error("You can't use save() on Bangle.js without overwriting the bootloader!"); }\n`;
|
||||||
// Apply any settings-specific stuff
|
// Apply any settings-specific stuff
|
||||||
|
@ -93,7 +93,6 @@ delete Bangle.showClock;
|
||||||
if (!Bangle.showClock) boot += `Bangle.showClock = ()=>{load(".bootcde")};\n`;
|
if (!Bangle.showClock) boot += `Bangle.showClock = ()=>{load(".bootcde")};\n`;
|
||||||
delete Bangle.load;
|
delete Bangle.load;
|
||||||
if (!Bangle.load) boot += `Bangle.load = load;\n`;
|
if (!Bangle.load) boot += `Bangle.load = load;\n`;
|
||||||
let date = new Date();
|
|
||||||
|
|
||||||
// show timings
|
// show timings
|
||||||
if (DEBUG) boot += `print(".boot0",0|(Date.now()-_tm),"ms");_tm=Date.now();\n`
|
if (DEBUG) boot += `print(".boot0",0|(Date.now()-_tm),"ms");_tm=Date.now();\n`
|
||||||
|
@ -211,10 +210,3 @@ E.showMessage(/*LANG*/"Reloading...");
|
||||||
// .bootcde should be run automatically after if required, since
|
// .bootcde should be run automatically after if required, since
|
||||||
// we normally get called automatically from '.boot0'
|
// we normally get called automatically from '.boot0'
|
||||||
eval(require('Storage').read('.boot0'));
|
eval(require('Storage').read('.boot0'));
|
||||||
/*
|
|
||||||
f = require("Storage").read("sched.clkinfo.js")
|
|
||||||
if (f.startsWith("Modules.addCached")) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "boot",
|
"id": "boot",
|
||||||
"name": "Bootloader",
|
"name": "Bootloader",
|
||||||
"version": "0.64",
|
"version": "0.65",
|
||||||
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
|
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
|
||||||
"icon": "bootloader.png",
|
"icon": "bootloader.png",
|
||||||
"type": "bootloader",
|
"type": "bootloader",
|
||||||
|
|
Loading…
Reference in New Issue