Optimizing ARM Cortex M3 code

前端 未结 3 1544
忘了有多久
忘了有多久 2021-01-07 05:14

I have a C Function which tries to copy a framebuffer to FSMC RAM.

The functions eats the frame rate of the game loop to 10FPS. I would like to know how to analyze

3条回答
  •  忘掉有多难
    2021-01-07 05:21

    You should start by compiling the C code with speed optimizations enabled. The disassembled code you provide appears to be storing the i and j counters on the stack, which adds 3 load/store operations to the inner loop. You might also want to inline LCD_WriteData in the inner loop.

    On the other hand, if you are really writing to the LCD in the inner loop then the performance may be limited by that interface.

提交回复
热议问题