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.getSecurityStatus 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
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.
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:
connection.on('error'...)
BluetoothRemoteGATTServer.startBonding
to initiate bonding with Puck.js as the central device, which can include a secure connectionArray.indexOf
finally getsfromIndex
supportDate
setters and timezone support withE.setTimeZone
. You can now finally get the correct time based on your country's timezone, without having to manually tweak the date.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.save()
- and are also dumped to the console usingdump()
NRF.getAdvertisingData
as well as the ability to supply an array of objects toNRF.setAdvertising
to allow for some pretty advanced use of advertisingBluetoothRemoteGATTServer.getSecurityStatus
to allow the security status of a Bluetooth central link to be checkedatob
andbtoa
now use flat strings for their output if possible, so are way more memory efficient than before.Puck.magTemp()
function to get the magnetometer's temperature as well as the BLE module'sE.set/getFlags
to allow interpreter state to be set and queried from one placeThere are a whole bunch of fixes too - check them out here: http://www.espruino.com/ChangeLog
A few of the main ones are:
.
- which could break some parsers