You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • 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.

            lsr r0,#3
            lsr r1,#2
            lsr r2,#3
            lsl r0,#11
            lsl r1,#5
            add r0,r1
            add r0,r2
            mov r1,r0
            lsl r0,#8
            lsr r1,#8
            add r0,r1
            mov r1,#65535
            and r0,r1
    return: bx lr

    Next changed reading function in displaydriver to:

    var zzz = new Uint8Array([0,0,0]);
    sData = {
      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.


Avatar for JumJum @JumJum started