Added support clearing display at 0 brightness for DIY Boards to AgOledDisplay.

Currently, the only affect the brightness setting has with the DIY boards is an attempt to set the contrast. 

Setting the contrast to 0 does not have any effect. 
This appears to be a know limitation for these display boards.
This commit is contained in:
Dmitry Pustovit
2024-09-20 00:36:34 -07:00
committed by GitHub
parent fd2cef153e
commit c4024f49fb

View File

@ -424,7 +424,17 @@ void OledDisplay::setBrightness(int percent) {
DISP()->setContrast((127 * percent) / 100);
}
} else if (ag->isBasic()) {
ag->display.setContrast((255 * percent) / 100);
if (percent == 0) {
isDisplayOff = true;
// Clear display.
ag->display.clear();
ag->display.show();
}
else {
isDisplayOff = false;
ag->display.setContrast((255 * percent) / 100);
}
}
}