It's very interesting, to see, what experts like Gordon can do with Javascript on this small board.
I learned a lot. But still the function is very slow. Reading a block of 20*20 pixel takes 0.6 seconds.
Therefore I gave the new assembler interface a chance and created a short function with flat assembler.
Next changed reading function in displaydriver to:
var zzz = new Uint8Array([0,0,0]);
sData = sData.map(function() {
var d = spi.send(zzz);
return ILIcalc(d[0],d[1],d[2]); //ILIcalc is the name of new assembler based function
});
Now it takes 0.34 seconds, 44% faster.
This is still not as fast as I would like, but it shows how helpful assembler can be.
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.
It's very interesting, to see, what experts like Gordon can do with Javascript on this small board.
I learned a lot. But still the function is very slow. Reading a block of 20*20 pixel takes 0.6 seconds.
Therefore I gave the new assembler interface a chance and created a short function with flat assembler.
Next changed reading function in displaydriver to:
Now it takes 0.34 seconds, 44% faster.
This is still not as fast as I would like, but it shows how helpful assembler can be.