if I'd like to disable the console mode on the BT port if running without a USB connection (for always running an application-specific interface on BT). How would I do that?
Is there an init/setup handler after the boot process? Espruino seems to load every other state fine from flash, but this setting would have to be done by an explicit call.
For now I'm calling USB.setConsole() every time in the onData handler of Serial1 which does not seem to be extremely elegant. Also I'm missing a way of flushing/purging the output buffer of the BT port (it otherwise still will transfer "Console Moved to USB" as well as some initial data on first connect)
Any hints on an boot/init handler and that flushing of the output buffer?
I think Espruino actually jumps out of USB console if it knows it isn't connected. You could try connecting to Serial5 or something that's out the way?
Just write a function called onInit and it'll be executed automatically at boot. If you stick the Serial5.setConsole in there then it should work fine...
Cool. onInit is what I was looking for. Thanks. Could have guessed myself.
It's not in the reference, yet, it seems. Just mentioned once in dump() now that I knew what to look for.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem