Add display inversion for cooling

This commit is contained in:
Ben V. Brown
2017-08-13 12:48:16 +10:00
parent a9da6d511b
commit 1d602bd9a1
3 changed files with 16 additions and 10 deletions

View File

@@ -17,6 +17,7 @@ void OLED_Sync();
void Oled_DrawArea(u8 x0, u8 y0, u8 wide, u8 height, const u8* ptr);
void Set_ShowPos(u8 x, u8 y);
void Oled_DisplayFlip();
void OLED_InvertBuffer();
void GPIO_Init_OLED(void);
void Init_Oled(uint8_t leftHanded);
const u8* Data_Command(u8 len, const u8* ptr);

View File

@@ -731,11 +731,13 @@ void DrawUI() {
Clear_Screen();
OLED_DrawString(CoolingPromptString, 5);
temp = readIronTemp(0, 1, 0xFFFF); //force temp re-reading
if (temp < 500 || ((millis() % 1000) > 500)
|| (!systemSettings.coolingTempBlink))
drawTemp(temp, 5, systemSettings.temperatureRounding);
if (temp > 300)
Oled_DisplayOn();
if (temp > 500 && systemSettings.coolingTempBlink
&& (millis() % 600) > 300)
OLED_InvertBuffer();
break;
case UVLOWARN:
OLED_DrawString(UVLOWarningString, 8);

View File

@@ -136,7 +136,10 @@ void Oled_DrawArea(u8 x, u8 y, u8 wide, u8 height, const u8* ptr) {
}
}
void OLED_InvertBuffer() {
for (uint16_t i = 0; i < (2 * 96); i++)
displayBuffer[i] = ~displayBuffer[i];
}
/*******************************************************************************
Function:GPIO_Init_OLED
Description:Init the outputs as needed for the OLED (in this case the RST line)