Repository navigation
Bug Fix: Remove sendCommand(NORMALDISPLAY) from setContrast() - #427
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds a forceNormal parameter to the setContrast and setBrightness methods to allow users to preserve the current display mode (normal/inverted) when adjusting brightness or contrast settings. The parameter defaults to true for backward compatibility.
Key changes:
- Added
forceNormalboolean parameter (default:true) tosetContrastandsetBrightnessmethods - Modified implementations to conditionally apply normal display mode based on the new parameter
- Updated documentation in header file and README to describe the new parameter behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/OLEDDisplay.h | Added forceNormal parameter with default value to method signatures and updated documentation comments |
| src/OLEDDisplay.cpp | Implemented conditional logic for forceNormal parameter in both methods and passed parameter through from setBrightness to setContrast |
| README.md | Updated API documentation to reflect the new parameter and its behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…parameter and preserve display mode state
Contributor
Author
|
Based on discussion in issue #427 - updating PR to simply remove |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the
setContrastmethod to fix an unwanted call to reset the display toNORMALDISPLAYmode rather than just sending the contrast related commands.Removes
sendCommand(NORMALDISPLAY):Minor:
README.mdandsrc/OLEDDisplay.hto clarify thatsetBrightnessis a convenience method forsetContrastwith only the brightness parameter. [1] [2]Closes #426