adafruit / Adafruit_SSD1306

Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs
http://www.adafruit.com/category/63_98
Other
1.81k stars 984 forks source link

add displayRegional method #235

Open DeqingSun opened 2 years ago

DeqingSun commented 2 years ago

update region instead of full screen to save time. In my test, this improvement saves 95% communication time to update a parameter on a 128x64 display, and solves the audio glitch issue.

Tested on 128x64 I2C display, SPI not tested but should work.

ladyada commented 2 years ago

hi thanks for the pr! we do have this idea but it would be implemented as window tracking - ideally this library would be refactored to subclass https://github.com/adafruit/Adafruit-GFX-Library/blob/master/Adafruit_GrayOLED.cpp (or, for now, that capability added here) instead of manually trakcing update rectangles!

DeqingSun commented 2 years ago

Great I saw the variables window_x1, etc. That is definitely easier for graphics application. However for text application, I do need to draw a rectangle to do a local erase before update text. So the manually tracking is pretty straight forward.

But even window_x1 get fully implemented, the library still need to do the job like this function? There can be another function call the displayRegional with variables window_x1.

ladyada commented 2 years ago

i would really prefer not to add it because no other OLED driver does it. i think window tracking will give very significant speedups!