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 there are some great new additions:

    The biggest one is E.setFlags({pretokenise:1})

    This puts the JS interpreter into a mode where any function that's defined is tokenised as it is stored. All reserved words are squashed down to a single byte, and all whitespace is removed. It seems to give a 10-20% speedup of execution, but crucially it hugely reduces the memory usage.

    So if you're having problems with memory usage, type E.setFlags({pretokenise:1}) on the left-hand side of the IDE, then re-upload and see what happens.

    There's also:

    • NetworkJS error reporting - errors reported by ESP8266/GSM connections can now be handled nicely with connection.on('error'...)
    • Autocompleted pin names - it's small, but really useful if you're typing on the left-hand side of the IDE and hit Tab to autocomplete the available pins
    • Puck.js - you can now call BluetoothRemoteGATTServer.startBonding to initiate bonding with Puck.js as the central device, which can include a secure connection
    • Hardware 'clear to send' flow control on any Serial device - this can be really useful when Espruino is receiving high speed serial data from devices (for example ESP8266) and the input buffer could get full up
    • Array.indexOf finally gets fromIndex support
    • Puck.js random numbers are now seeded from the hardware random number generator on boot
    • Date setters and timezone support with E.setTimeZone. You can now finally get the correct time based on your country's timezone, without having to manually tweak the date.
    • Serial error handling is now disabled by default and enabled via an option in Serial.setup. Previously framing/parity errors were added to the input queue regardless, and could fill it up quickly in the case of invalid serial data.
    • Puck.js services and advertising are now re-initialised after save() - and are also dumped to the console using dump()
    • Puck.js: Added NRF.getAdvertisingData as well as the ability to supply an array of objects to NRF.setAdvertising to allow for some pretty advanced use of advertising
    • Puck.js: Added BluetoothRemoteGATTServer.getSecuritySta­tus to allow the security status of a Bluetooth central link to be checked
    • Puck.js: Auto-whitelisting now disabled by default (fixes connection problems with other devices after bonding)
    • atob and btoa now use flat strings for their output if possible, so are way more memory efficient than before.
    • Puck.js: Added Puck.magTemp() function to get the magnetometer's temperature as well as the BLE module's
    • Added E.set/getFlags to allow interpreter state to be set and queried from one place

    There are a whole bunch of fixes too - check them out here: http://www.espruino.com/ChangeLog

    A few of the main ones are:

    • A whole selection of Puck.js stability/reliability tweaks
    • Fix the multiple end/close callbacks that happened on TCP/IP sockets
    • NFC fixes on Puck.js (after using NFC, Puck.js could get stuck in a high power mode)
    • Puck.js neopixel library now colors the first LED correctly
    • Floating point numbers are now never output with a trailing . - which could break some parsers
    • Added regex parsing (not actual regex support, but now you'll get a helpful error)
    • Fix dumping of ArrayBuffers containing data - it now produced valid executable JS
About

Avatar for Gordon @Gordon started