You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • This release has been a long time coming - mainly delayed because of my work on the Pico. However a lot of that work has made its way into the core firmware, so there are some really great improvements in it:

    Real-time clock

    The real-time clock will now remember the time that has passed since Espruino last had power, regardless of whether it was reset inbetween or not. This means that if you connect Espruino to a battery you can just set the time, and it will keep track of it until the battery is removed.

    Arrays in digitalPulse

    You can now do something like digitalPulse(LED1,1,[100,200,300,400,500­,600]); to quickly create a square wave with the given pulse lengths. This is great for radio or Infra-red transmission.

    Linux/Raspberry Pi improvements

    If you want to run Espruino on Raspberry Pi, you now get much faster IO and interrupt-driven setWatch, courtesy of WiringPi. A separate thread for handling input means that you get much better behaviour when idle, and Ctrl-C can break out of running code.

    You can also access Serial ports - for instance: Serial1.setup({path:"/dev/ttyUSB0"})

    Socket Support via net library and MQTT

    This means you can now do much lower level stuff on the network - including MQTT (Lars has kindly made a module to do this for you)

    setWatch can now execute native functions from inside the IRQ

    This is pretty low level stuff, but by specifying irq:true in setWatch you can now run inline assembler from within a setWatch IRQ. This has some great uses for stuff like decoding radio or scanning out displays.

    Added 'flat strings'

    Espruino normally uses fixed-size blocks of memory for variables, which stops it having problems with memory fragmentation. However often you'll want to allocate one big lump of memory for an array, and 'flat strings' now do this. For the moment they're only allocated when you create a typed array (like Uint8Array), but over time they'll be rolled out to more things.

    Compiled functions

    Using the new Web IDE (automatically rolling out now), you can use a JavaScript compiler on your PC to compile JavaScript down to ARM instructions that run directly on the processor. It's still very early days for this, but the performance is already really promising.

    For instance see the speed difference when uploading the code below, with and without the string "compiled";

    function f() {
      "compiled";
      var Xr = 0;
      var Xi = 0;
      var i = 0;
      var Cr=(4*x/32)-2;
      var Ci=(4*y/32)-2;  
      while ((i<32) & ((Xr*Xr+Xi*Xi)<4)) {
        var t=Xr*Xr - Xi*Xi + Cr;
        Xi=2*Xr*Xi+Ci;
        Xr=t;
        i=i+1;
      }
      return i;
    }
    
    var x,y;
    for (y=0;y<32;y++) {
     line="";
     for (x=0;x<32;x++) 
       line += " *"[f()&1];
     print(line);
    }
    

    There's more info on this here.

    Machine code in variables

    This one means that if you write inline assembler (or the new 'compiled' functions) the assembler will get loaded into a variable - which means it's loaded and saved along with everything else.

    Peek and Poke can now act on multiple bits of data

    For instance peek8(0x20000000,8) now returns the first 8 bytes of RAM as an array. While not so useful for accessing the internal peripherals, it's great if you've written something into Espruino's flash and you want to access it.

    Graphics an ArrayBuffer write performance

    The speed of the graphics library (especially fills to ArrayBuffers) has now improved a great deal. It should really help when using higher resolution displays like the Memory LCDs.

    VGA and TV output

    You can now plug a VGA monitor or TV straight into Espruino using the tv module!

    The video below is from a few weeks back. It now does work well on the Pico too!

    https://www.youtube.com/watch?v=U-XOUVkj­LKg

    E.toString and E.toUint8Array

    It's always been a bit of a pain to convert between the two most efficient types of storage in Espruino. You can now use E.toString(...) and E.toUint8Array(...) to create strings or Uint8Arrays from whatever arguments you supply.

    Multi-byte OneWire read and write

    This really helps to tidy code up, especially for:

    EEPROM support

    @DrAzzy's done loads of work on supporting several different types of EEPROMS (all with the same API). It means you've not got a very quick and easy way of storing data in a non-volatile way.

    ESP8266 WiFi support

    There's now support for the ESP8266 WiFi module as well, but you'll have to flash the special firmware first.

    Finally...

    There are loads of other small bug fixes, optimisations and improvements. If you want a full list, you can check out the ChangeLog

About

Avatar for Gordon @Gordon started