Optimize MAX7456 driver invert and brightness functions
commitf1e3c60dd95a8ba22db3ff52f6398c5962dbd99f
authorBruce Luckcuck <github@etracer.net>
Tue, 5 Feb 2019 16:55:20 +0000 (5 11:55 -0500)
committerBruce Luckcuck <github@etracer.net>
Tue, 5 Feb 2019 17:02:34 +0000 (5 12:02 -0500)
tree2e0c1ac3ade6f7754d859d553253db84696309e4
parentaf84f9e99df897ead45d3c33c610133ef0ad5511
Optimize MAX7456 driver invert and brightness functions
Eliminate unnecessary register writes by keeping previous state information and only writing the registers when the related settings actually change. Saves 17 register writes per `clearScreen()` call.

Also fixed character invert flag handling. Previously changes to the flag would only affect subsequently drawn characters and previous characters would remain unchanged. So for static OSD elements it produced an inconsistent state. Now all characters immediately reflect the current state of the invert flag.

Results in appoximately a 33% reduction in processing time for the OSD task at default settings (~31us reduced to ~21us on F405).
src/main/drivers/max7456.c