mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Add display inversion for cooling
This commit is contained in:
@@ -17,6 +17,7 @@ void OLED_Sync();
|
|||||||
void Oled_DrawArea(u8 x0, u8 y0, u8 wide, u8 height, const u8* ptr);
|
void Oled_DrawArea(u8 x0, u8 y0, u8 wide, u8 height, const u8* ptr);
|
||||||
void Set_ShowPos(u8 x, u8 y);
|
void Set_ShowPos(u8 x, u8 y);
|
||||||
void Oled_DisplayFlip();
|
void Oled_DisplayFlip();
|
||||||
|
void OLED_InvertBuffer();
|
||||||
void GPIO_Init_OLED(void);
|
void GPIO_Init_OLED(void);
|
||||||
void Init_Oled(uint8_t leftHanded);
|
void Init_Oled(uint8_t leftHanded);
|
||||||
const u8* Data_Command(u8 len, const u8* ptr);
|
const u8* Data_Command(u8 len, const u8* ptr);
|
||||||
|
|||||||
@@ -269,14 +269,14 @@ void ProcessUI() {
|
|||||||
operatingMode = SOLDERING;
|
operatingMode = SOLDERING;
|
||||||
Oled_DisplayOn();
|
Oled_DisplayOn();
|
||||||
return;
|
return;
|
||||||
} else if (systemSettings.sensitivity&& !InterruptMask) {
|
} else if (systemSettings.sensitivity && !InterruptMask) {
|
||||||
if (millis() - getLastMovement() < 1000) {//moved in the last second
|
if (millis() - getLastMovement() < 1000) {//moved in the last second
|
||||||
operatingMode = SOLDERING; //Goto active mode again
|
operatingMode = SOLDERING; //Goto active mode again
|
||||||
Oled_DisplayOn();
|
Oled_DisplayOn();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (systemSettings.sensitivity ) {
|
if (systemSettings.sensitivity) {
|
||||||
//Check if we should shutdown
|
//Check if we should shutdown
|
||||||
if ((millis() - getLastMovement()
|
if ((millis() - getLastMovement()
|
||||||
> (systemSettings.ShutdownTime * 60000))
|
> (systemSettings.ShutdownTime * 60000))
|
||||||
@@ -459,7 +459,7 @@ void DrawUI() {
|
|||||||
|
|
||||||
//Now draw symbols
|
//Now draw symbols
|
||||||
if (StatusFlags == 8)
|
if (StatusFlags == 8)
|
||||||
OLED_DrawExtraFontChars(2,4);
|
OLED_DrawExtraFontChars(2, 4);
|
||||||
else {
|
else {
|
||||||
OLED_DrawChar(' ', 4);
|
OLED_DrawChar(' ', 4);
|
||||||
}
|
}
|
||||||
@@ -482,10 +482,10 @@ void DrawUI() {
|
|||||||
|
|
||||||
if (systemSettings.displayTempInF) {
|
if (systemSettings.displayTempInF) {
|
||||||
//OLED_DrawChar(SettingTempFChar, 3);
|
//OLED_DrawChar(SettingTempFChar, 3);
|
||||||
OLED_DrawExtraFontChars(0,3);
|
OLED_DrawExtraFontChars(0, 3);
|
||||||
} else {
|
} else {
|
||||||
//OLED_DrawChar(SettingTempCChar, 3);
|
//OLED_DrawChar(SettingTempCChar, 3);
|
||||||
OLED_DrawExtraFontChars(1,3);
|
OLED_DrawExtraFontChars(1, 3);
|
||||||
}
|
}
|
||||||
//Optionally draw the arrows, or draw the power instead
|
//Optionally draw the arrows, or draw the power instead
|
||||||
if (systemSettings.powerDisplay) {
|
if (systemSettings.powerDisplay) {
|
||||||
@@ -731,11 +731,13 @@ void DrawUI() {
|
|||||||
Clear_Screen();
|
Clear_Screen();
|
||||||
OLED_DrawString(CoolingPromptString, 5);
|
OLED_DrawString(CoolingPromptString, 5);
|
||||||
temp = readIronTemp(0, 1, 0xFFFF); //force temp re-reading
|
temp = readIronTemp(0, 1, 0xFFFF); //force temp re-reading
|
||||||
if (temp < 500 || ((millis() % 1000) > 500)
|
|
||||||
|| (!systemSettings.coolingTempBlink))
|
drawTemp(temp, 5, systemSettings.temperatureRounding);
|
||||||
drawTemp(temp, 5, systemSettings.temperatureRounding);
|
if (temp > 300)
|
||||||
if(temp>300)
|
|
||||||
Oled_DisplayOn();
|
Oled_DisplayOn();
|
||||||
|
if (temp > 500 && systemSettings.coolingTempBlink
|
||||||
|
&& (millis() % 600) > 300)
|
||||||
|
OLED_InvertBuffer();
|
||||||
break;
|
break;
|
||||||
case UVLOWARN:
|
case UVLOWARN:
|
||||||
OLED_DrawString(UVLOWarningString, 8);
|
OLED_DrawString(UVLOWarningString, 8);
|
||||||
|
|||||||
@@ -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
|
Function:GPIO_Init_OLED
|
||||||
Description:Init the outputs as needed for the OLED (in this case the RST line)
|
Description:Init the outputs as needed for the OLED (in this case the RST line)
|
||||||
|
|||||||
Reference in New Issue
Block a user