-
-
Notifications
You must be signed in to change notification settings - Fork 37.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix oled_render to render all dirty blocks. #18887
Conversation
Actually Now, if the whole OLED was marked dirty, for a 128×32 OLED just the data for those blocks would occupy 512 bytes, and transferring those 512 bytes over a 400 kHz I2C would take about 12 ms even without taking the command overhead into account; a 128×64 OLED would require more than 25 ms to transfer the whole data at once. However, dividing the 128×32 OLED data into 16 blocks results in 32 bytes per block, which brings the data transfer time below 1 ms (not counting the command overhead again). One possible fix that won't result in excessive delays during OLED updates is to save the last updated block number between updates and continue from the next block instead of starting the search from the first block every time; this could result in some mix of old and new data during updates, but would probably better than stopping the update on the first dirty block. |
I think that is a good idea ... and have |
The current quick fix will probably be #19068 (it effectively reverts your PR by default to avoid introducing latency problems, but you can set Note that in many cases the problem that you are attempting to fix is actually caused by some bug in the As for changing the behavior for an explicit call of |
Description
oled_render
is meant to render all dirty changes to the device, but it only renders the first dirty block it finds. In practice this does not usually cause much of a problem because it is called periodically fromoled_task
, and eventually it works its way through all dirty blocks and they get rendered.However, if you update the oled very fast, like in an animation, the first blocks are made re-dirty before the
oled_task
loop can catch up w/ rendering the later blocks. This causes the later blocks to not get rendered.This change fixes that problem by rendering all dirty blocks in
oled_render
which is what I believe users of that function would expect it to do.Types of Changes
Issues Fixed or Closed by This PR
Checklist