-
Notifications
You must be signed in to change notification settings - Fork 638
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
More printing fixes #399
More printing fixes #399
Conversation
* setLogBuffer needs to be re-called (and past buffer cleared) every time a `setFont` happens, as this changes the number of lines and chars. It now does not take arguments anymore and does things internally and is clearer about when it gives up. * calculation of shiftUp for when on last line was wrong
The the fewer the parameters, the better 👍 However, breaking public API is not something that we take lightly. We could keep the old function in the API for the time being. It could print a deprecation message to serial and delegate to the new function? |
I'm not so sure I can think of any scenario where the user would want to interact with either drawLogBuffer or setLogBuffer. Maybe we should rename them to something that's private or protected and print deprecation msgs for both? |
"deprecated: print functionality now handles buffer management automatically" ? |
Whatever we do, we can't remove functions from public API without a major version bump. Hence, I suggest something like bool OLEDDisplay::setLogBuffer(uint16_t lines, uint16_t chars) {
Serial.println("[deprecated] Print functionality now handles buffer management automatically. This is a no-op.");
}
|
It occurred to me that it's maybe cleaner to have |
old versions with arguments deprecated, new versions protected.
5545dd3
to
507ddcc
Compare
This looks sane, thanks a lot. |
setFont
happens, as this changes the number of lines and chars. It now does not take arguments anymore and does things internally and is clearer about when it gives up.