So this brings me to the final hackish """solution""" I came up with for keeping the display on during initial bootloading:
if (require("Storage").read(".bootrn")) {
require("Storage").erase(".bootrn");
Bangle.setLCDPower(0);
}
Bangle.on("lcdPower", function onLcdPower(on) {
if (!on && " random" === clockApp) {
Bangle.removeListener("lcdPower", onLcdPower);
require("Storage").write(".bootrn", "1");
load();
}
});
When powering off, a 1-byte file is written to .bootrn and when bootloading, the existence of that file is checked. I don't need to tell you that this is an ugly hack... but it works :)
So anyway this was my journey thus far in trying to accomplish a real-time random clock face.
Question:
Is there any way less invasive than calling load() to accomplish this, as I have? The entire flicker hack can be removed if so. I tried things to get around this, e.g. wrapping the clock/child application in an IIFE, evaluating it, and then deleteing the function. Nothing besides load() seemed to reliably do the trick without a bunch of memory leakage.
Also, the limit for this forum is kinda low. I'm only replying to continue the thread like this because I ran out of characters, lol.
Anyways, I'll attach the bootloader.js and settings.js in case anyone wants to mess around with it.
P.S. I was scared to load a different bootloader to my watch but I went for it!
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
So this brings me to the final hackish """solution""" I came up with for keeping the display on during initial bootloading:
When powering off, a 1-byte file is written to
.bootrn
and when bootloading, the existence of that file is checked. I don't need to tell you that this is an ugly hack... but it works :)So anyway this was my journey thus far in trying to accomplish a real-time random clock face.
Question:
Is there any way less invasive than calling
load()
to accomplish this, as I have? The entire flicker hack can be removed if so. I tried things to get around this, e.g. wrapping the clock/child application in an IIFE, evaluating it, and thendelete
ing the function. Nothing besidesload()
seemed to reliably do the trick without a bunch of memory leakage.Also, the limit for this forum is kinda low. I'm only replying to continue the thread like this because I ran out of characters, lol.
Anyways, I'll attach the
bootloader.js
andsettings.js
in case anyone wants to mess around with it.P.S. I was scared to load a different bootloader to my watch but I went for it!
2 Attachments