Why do you do e.target.result.replace(/\n/g, "\x1B\x0A")? I think this is changing newline to alt-enter? In the IDE it's a hack to get around people who write code with the opening brackets for functions on a different line.
By sending alt-enter for everything you cause the entire file to be stored in the input buffer before being executed, rather than executed one function at a time - it'll mean you can't upload anywhere near as much code before running out of memory.
flash
This'll be pretty difficult to pull out. Do you seriously need that? Can't you just connect with the Web IDE when you (rarely) need to update the firmware?
console.error("Already sending data - calling callback immediately!");
Yeah, this is because I changed the serial code recently and put it in for debug. It's actually not a big problem.
The issue is that with the 'throttled send', the buffer gets added to a send queue but the callback gets called immediately. It should really be a warning, and infact serial.js should really handle it and should be able to call the callbacks in turn - but i'm lazy
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.
Why do you do
e.target.result.replace(/\n/g, "\x1B\x0A")
? I think this is changing newline to alt-enter? In the IDE it's a hack to get around people who write code with the opening brackets for functions on a different line.By sending alt-enter for everything you cause the entire file to be stored in the input buffer before being executed, rather than executed one function at a time - it'll mean you can't upload anywhere near as much code before running out of memory.
This'll be pretty difficult to pull out. Do you seriously need that? Can't you just connect with the Web IDE when you (rarely) need to update the firmware?
Yeah, this is because I changed the serial code recently and put it in for debug. It's actually not a big problem.
The issue is that with the 'throttled send', the buffer gets added to a send queue but the callback gets called immediately. It should really be a warning, and infact
serial.js
should really handle it and should be able to call the callbacks in turn - but i'm lazy