One last observation to report.
I noticed that after
commit 49b4b523accc22539eb4156085cde748a208170a Author: Gordon
Williams gw@pur3.co.uk Date: Fri Jun 5 09:52:56 2020 +0100
Bangle.js: Improve SPI flash speed by with specific function for reading and keeping CS asserted ( #1849)
there was only one caller left to spiFlashReadWrite, namely in spiFlashStatus.
I figured I could equally well eliminate that function and replace it with a call to spiFlashWrite followed by a call to spiFlashRead
This works like a charm but degrades the performace a bit as jshFlashRead does not inline spiFlashRead any more. Without my change jshFlashRead was the only caller of spiFlashRead and the compiler or the post linker optimizer decided the function could be inlined.
Not any more after changing spiFlashStatus to use separate Read and Write calls.
It might we worthwhile to mark spiFlashRead and spiFlashWrite as inline functions. Thatwill (marginally) speed up jshFlashRead as the call to spiFlashWrite will be gone.
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.
One last observation to report.
I noticed that after
This works like a charm but degrades the performace a bit as jshFlashRead does not inline spiFlashRead any more. Without my change jshFlashRead was the only caller of spiFlashRead and the compiler or the post linker optimizer decided the function could be inlined.
Not any more after changing spiFlashStatus to use separate Read and Write calls.
It might we worthwhile to mark spiFlashRead and spiFlashWrite as inline functions. Thatwill (marginally) speed up jshFlashRead as the call to spiFlashWrite will be gone.