Oh, garbage collection... yes, that could be the reason for some oddities.
@Gordon, one little tweak with (hopefully) a big impact could be to change the SPI.write function so that you can pass a target buffer to it and it will write the results into that buffer instead of returning a new one.
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.
Oh, garbage collection... yes, that could be the reason for some oddities.
@Gordon, one little tweak with (hopefully) a big impact could be to change the
SPI.write
function so that you can pass a target buffer to it and it will write the results into that buffer instead of returning a new one.