You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • This one's been a while coming, but it's got a few nice additions/fixes:

    E.setBootCode and flash execution

    You might have noticed the Save on send option in the Web IDE - this uses E.setBootCode to save your code as-is to Espruino's flash memory. It's then executed straight from read-only memory and any functions you define are kept in flash.

    While this actually uses up more flash memory than the normal (compressed) arrangement, it can save you a lot of RAM.


    Espruino now has a 'Promise' library built-in on all but the most constrained platforms - so stuff like this now works:

    new Promise(function(resolve, reject) {
      var ok = false;
      // do stuff
      if (ok) {
        resolve("Stuff worked!");
      } else {
        reject("It broke");
    }).then(function(result) {
      console.log(result); // "Stuff worked!"
    }).catch(function(err) {
      console.log(err); // Error: "It broke"

    I know some people like programming like this (to avoid all that nesting) so this may help...

    process.on('uncaughtException', ...)

    This allows you to catch any exceptions that your code produced but that weren't caught. For instance you might want to log the exceptions to read-only memory for later debugging, or just light up a warning light.

    force argument on Serial.setConsole()

    For example with USB.setConsole(true), you can make sure that Espruino's console always stays on USB and doesn't get in the way of Serial, regardless of whether USB is subsequently plugged or unplugged.

    Fix software PWM glitches

    It used to be that whenever you modified software PWM, PWM was stopped and then started again, and this made it 'glitch'. This is now fixed so you can animate software PWM values without any glitches.


    Espruino's had E.enableWatchdog for a while - which checks that the interpreter is always going around the idle loop, but you can now do E.enableWatchdog(time, false) which means that if your code doesn't call E.kickWatchdog() within the time period the chip will auto-reset.

    It's a great way of making sure that your code really is running as expected.

    micro:bit improvements

    • micro:bit's show() function now works well with Graphics
    • Many nRF51/2 fixes and improvements
    • Fixing micro:bit compass issues

    Other Fixes and Improvements...

    • Telnet now built into linux builds (use --telnet to enable) - also some Telnet fixes
    • Finally added .removeListener so you can remove just one listener (for example when using multiple listeners on Serial)
    • Added require("Flash").getFree() as multiplatform way to find free flash pages
    • Add the ability to set clock frequencies on STM32F4 chips (like Pico) with E.setClock
    • Add E.setBootCode to allow JS scripts to be saved without being in RAM ()
    • Expecting a number or something iterable, got X changed to exception rather than warning (so you now get a stack trace of the error)
    • Ensure that pinMode/digitalWrite is re-constituted properly by dump() and save() (fix #833)
    • ESP8266: Some read-only variables moved to flash to save a whole bunch of RAM
    • GCC 5.3.1 now used for ARM release builds
    • Fix potential variable corruption issue when copying objects/arrays containing packed ints
    • ESP8266 printLog memory leak fixed
    • Added Object.get/setPrototypeOf that are nicer than accessing prot_ directly
    • Fix memory leak when executing bound function with 'this'
    • Fix issue when turning a negative Date to a string
    • Stop eval in a switch statement from confusing parsing
    • Fix regression in 'mode' argument of SPI.setup (allows custom CC3000 pins to work)
    • Fix '.on' with long event names
    • Enable F4Discovery button pull-down. Newer boards don't seem to have one fitted
    • Unterminated expressions now produce errors
    • New slow but memory efficient sin and atan for devices with really low memory

    For more info including bug numbers of fixed bugs, check out

    New product!

    Espruino WiFi has got a bit delayed due to some component sourcing issues, but I hope to have the first 100 available within the month now.

    However I'm about to launch a KickStarter for a new Bluetooth LE Espruino (with a case and battery), which we're calling Puck.js. It should be starting within the week if all goes well, and I'll post up some more details then...


Avatar for Gordon @Gordon started