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

@@ -269,14 +269,14 @@ void ProcessUI() {
operatingMode = SOLDERING;
Oled_DisplayOn();
return;
} else if (systemSettings.sensitivity&& !InterruptMask) {
} else if (systemSettings.sensitivity && !InterruptMask) {
if (millis() - getLastMovement() < 1000) {//moved in the last second
operatingMode = SOLDERING; //Goto active mode again
Oled_DisplayOn();
return;
}
}
if (systemSettings.sensitivity ) {
if (systemSettings.sensitivity) {
//Check if we should shutdown
if ((millis() - getLastMovement()
> (systemSettings.ShutdownTime * 60000))
@@ -459,7 +459,7 @@ void DrawUI() {
//Now draw symbols
if (StatusFlags == 8)
OLED_DrawExtraFontChars(2,4);
OLED_DrawExtraFontChars(2, 4);
else {
OLED_DrawChar(' ', 4);
}
@@ -482,10 +482,10 @@ void DrawUI() {
if (systemSettings.displayTempInF) {
//OLED_DrawChar(SettingTempFChar, 3);
OLED_DrawExtraFontChars(0,3);
OLED_DrawExtraFontChars(0, 3);
} else {
//OLED_DrawChar(SettingTempCChar, 3);
OLED_DrawExtraFontChars(1,3);
OLED_DrawExtraFontChars(1, 3);
}
//Optionally draw the arrows, or draw the power instead
if (systemSettings.powerDisplay) {
@@ -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)
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)