-
• #2
Is
E.setFlags({pretokenise:1})
compatible withModules uploaded as functions
?
Could combing the two add any adventage? -
• #3
It is, but it depends how you use it...
pretokenise
+modules as functions
will still work, but won't realistically be any better than justpretokenise
.Save on send
+modules as functions
will load your code into flash memory, so in that case the functions won't be tokenised at all since they're read only - so you won't see any difference. -
• #4
looks great!
-
• #5
Nice updates.
One question about bonding: Is it necessary that the Puck establishes the connection to a device or is it also possible to listen for a connection establishment by a smartphone and then start the bonding? -
• #6
If some other device is connecting to Puck.js, then that device can request bonding and Puck.js will bond - however as far as I know if it up to the connecting device to initiate the bonding.
-
• #7
Is there ever any reason not to pretokenize?
-
• #8
If you wanted to be able to
dump()
the code that you'd uploaded (or edit functions in-place withedit
) then it'd be a pain as it would remove all formatting and effectively output 'minified' code for you, but yes, in a lot of cases you could leave it 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