The first thing I noticed was you changed:
buf.set(data, bufIdx); var idx = bufIdx+data.indexOf("\1"); bufIdx += data.length;
to
buf.set(data, bufIdx); bufIdx += data.length; if (data.indexOf("\1") >= 0) { var idx = bufIdx + data.indexOf("\1");
Obviously that's going to change the value of idx, so is a good place to start :)
idx
@Gordon started
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.
The first thing I noticed was you changed:
to
Obviously that's going to change the value of
idx
, so is a good place to start :)