Taranis-based B/W: Initial Contrast fix
This commit is contained in:
@@ -952,10 +952,6 @@ void drawGPSSensorValue(coord_t x, coord_t y, TelemetryItem & telemetryItem, Lcd
|
||||
drawGPSPosition(x, y, telemetryItem.gps.longitude, telemetryItem.gps.latitude, flags);
|
||||
}
|
||||
|
||||
void lcdSetContrast()
|
||||
{
|
||||
lcdSetRefVolt(g_eeGeneral.contrast);
|
||||
}
|
||||
|
||||
#define LCD_BYTE_FILTER(p, keep, add) *(p) = (*(p) & (keep)) | (add)
|
||||
|
||||
@@ -999,6 +995,15 @@ void lcdDraw1bitBitmap(coord_t x, coord_t y, const uint8_t * img, uint8_t idx, L
|
||||
|
||||
#endif
|
||||
|
||||
void lcdSetContrast(bool useDefault)
|
||||
{
|
||||
#if defined(BOOT)
|
||||
lcdSetRefVolt(LCD_CONTRAST_DEFAULT);
|
||||
#else
|
||||
lcdSetRefVolt(useDefault ? LCD_CONTRAST_DEFAULT : g_eeGeneral.contrast);
|
||||
#endif
|
||||
}
|
||||
|
||||
void lcdMaskPoint(uint8_t * p, uint8_t mask, LcdFlags att)
|
||||
{
|
||||
ASSERT_IN_DISPLAY(p);
|
||||
|
||||
@@ -820,12 +820,17 @@ void drawGPSSensorValue(coord_t x, coord_t y, TelemetryItem & telemetryItem, Lcd
|
||||
}
|
||||
}
|
||||
|
||||
void lcdSetContrast()
|
||||
{
|
||||
lcdSetRefVolt(g_eeGeneral.contrast);
|
||||
}
|
||||
#endif // BOOT
|
||||
|
||||
void lcdSetContrast(bool useDefault)
|
||||
{
|
||||
#if defined(BOOT)
|
||||
lcdSetRefVolt(LCD_CONTRAST_DEFAULT);
|
||||
#else
|
||||
lcdSetRefVolt(useDefault ? LCD_CONTRAST_DEFAULT : g_eeGeneral.contrast);
|
||||
#endif
|
||||
}
|
||||
|
||||
void lcdMaskPoint(uint8_t *p, uint8_t mask, LcdFlags att)
|
||||
{
|
||||
if ((p) >= DISPLAY_END) {
|
||||
|
||||
@@ -226,6 +226,10 @@ void boardInit()
|
||||
#endif
|
||||
|
||||
backlightInit();
|
||||
|
||||
#if defined(GUI)
|
||||
lcdSetContrast(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void boardOff()
|
||||
|
||||
@@ -951,7 +951,9 @@ void lcdRefresh();
|
||||
void lcdRefresh(bool wait=true); // TODO uint8_t wait to simplify this
|
||||
#endif
|
||||
void lcdSetRefVolt(unsigned char val);
|
||||
void lcdSetContrast();
|
||||
#ifdef __cplusplus
|
||||
void lcdSetContrast(bool useDefault = false);
|
||||
#endif
|
||||
|
||||
// Top LCD driver
|
||||
#if defined(TOPLCD_GPIO)
|
||||
|
||||
@@ -27,6 +27,7 @@ extern MemoryType memoryType;
|
||||
|
||||
void bootloaderInitScreen()
|
||||
{
|
||||
lcdSetContrast(true);
|
||||
}
|
||||
|
||||
static void bootloaderDrawMsg(unsigned int x, const char *str, uint8_t line, bool inverted)
|
||||
|
||||
Reference in New Issue
Block a user