Something in my loadSettings function in 'interface.html' to read the json file on the bangle is sometimes causing the code execution to get stuck bouncing back and forth between this function in 'puck.js'
// Did `write` and `eval` manage to create a connection?
isConnected : function() {
return connection!==undefined;
},
and this function in 'comms.js'
//TODO Switch to an event listener when Puck will support it
let interval = setInterval(() => {
if (connected === Puck.isConnected()) return;
connected = Puck.isConnected();
cb(connected);
}, 1000);
I think this is why the settings don't always load properly for the preview, it was around every third try opening the interface that it would load them and it would stay working for a while but then it would go back to using my default values.
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.
Something in my
loadSettings
function in 'interface.html' to read the json file on the bangle is sometimes causing the code execution to get stuck bouncing back and forth between this function in 'puck.js'and this function in 'comms.js'
I think this is why the settings don't always load properly for the preview, it was around every third try opening the interface that it would load them and it would stay working for a while but then it would go back to using my default values.