ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
1.98k stars 638 forks source link

Added drawLogBuffer(0,0) and display() at end of write() #389

Closed ropg closed 4 months ago

ropg commented 4 months ago

Now print, println and printf "just work" because they execute drawLogBuffer(0,0) and display() when done.

New protected boolean inhibitDrawLogBuffer makes sure display is not refreshed every character when a string of characters is written at once. I think this is the implementation of what was Helmut's TODO item at the beginning of the file, which read: "Finish _putc with drawLogBuffer when running display". Note that I moved the creation of the logbuffer from _putc() to write(), because we also want it it to "just work" on Arduino.

marcelstoer commented 4 months ago

Thanks. Can you please clean-up the white-space/formatting changes in write(). The diff is too large because of that.

I think this is the implementation of what was Helmut's TODO item at the beginning of the file

@helmut64 I think that refers to you 😄

ropg commented 4 months ago

I needed to change the indent on the whole block because there was a if (this->logBufferSize > 0) { wrapping most of write() that is not necessary anymore if we make sure there's always a logBuffer. Not sure how to not make a large commit when removing a wrapping condition like that.

marcelstoer commented 4 months ago

Oh, right...Once I looked at it outside the diff viewer I realized it's actually correct. Got confused by the diff. Sorry about that.