@allObjects there is a slight problem with that:
buffer.slice
new Uint8Array(buffer,p,C.OLED_CHUNK)
set
Basically the .set(new Uint8Array(buffer,x,y), z); pattern is about as close to a memcpy in JavaScript as you can get
.set(new Uint8Array(buffer,x,y), z);
memcpy
@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.
@allObjects there is a slight problem with that:
buffer.slice
creates a brand new sparse array - it uses lots of memory and time to createnew Uint8Array(buffer,p,C.OLED_CHUNK)
only creates a 'view' of the data - nothing is copied until theset
command.Basically the
.set(new Uint8Array(buffer,x,y), z);
pattern is about as close to amemcpy
in JavaScript as you can get