Fix warning bug

#94
This commit is contained in:
Ben V. Brown
2017-10-19 09:34:35 +11:00
parent 88b874681b
commit 3b8cd980a7
2 changed files with 17 additions and 15 deletions

View File

@@ -87,7 +87,7 @@ void resetSettings() {
systemSettings.BoostTemp = 420; //default to 400C systemSettings.BoostTemp = 420; //default to 400C
systemSettings.autoStartMode = 0; //Auto start off for safety systemSettings.autoStartMode = 0; //Auto start off for safety
systemSettings.coolingTempBlink = 0; //Blink the temperature on the cooling screen when its > 50C systemSettings.coolingTempBlink = 0; //Blink the temperature on the cooling screen when its > 50C
systemSettings.CalibrationOffset = 10; systemSettings.CalibrationOffset = 10; //This appears to be quite close for both of my tips, in both of my handles
systemSettings.temperatureInF = 0; //default to 0 systemSettings.temperatureInF = 0; //default to 0
saveSettings(); saveSettings();
} }

View File

@@ -663,6 +663,8 @@ void startGUITask(void const * argument) {
//^ Kept here for a way to block this thread //^ Kept here for a way to block this thread
for (;;) { for (;;) {
ButtonState buttons = getButtonState(); ButtonState buttons = getButtonState();
if (tempWarningState == 2)
buttons = BUTTON_F_SHORT;
switch (buttons) { switch (buttons) {
case BUTTON_NONE: case BUTTON_NONE:
//Do nothing //Do nothing
@@ -677,7 +679,7 @@ void startGUITask(void const * argument) {
lcd.clearScreen(); //Ensure the buffer starts clean lcd.clearScreen(); //Ensure the buffer starts clean
lcd.setCursor(0, 0); //Position the cursor at the 0,0 (top left) lcd.setCursor(0, 0); //Position the cursor at the 0,0 (top left)
lcd.setFont(1); //small font lcd.setFont(1); //small font
lcd.print((char*) "V2.00a4"); //Print version number lcd.print((char*) "V2.00a5"); //Print version number
lcd.setCursor(0, 8); //second line lcd.setCursor(0, 8); //second line
lcd.print(__DATE__); //print the compile date lcd.print(__DATE__); //print the compile date
lcd.refresh(); lcd.refresh();
@@ -695,15 +697,13 @@ void startGUITask(void const * argument) {
lcd.displayOnOff(true); //turn lcd on lcd.displayOnOff(true); //turn lcd on
gui_solderingMode(); //enter soldering mode gui_solderingMode(); //enter soldering mode
tempWarningState = 0; //make sure warning can show tempWarningState = 0; //make sure warning can show
HAL_IWDG_Refresh(&hiwdg);
break; break;
case BUTTON_B_SHORT: case BUTTON_B_SHORT:
lcd.setFont(0); lcd.setFont(0);
lcd.displayOnOff(true); //turn lcd on lcd.displayOnOff(true); //turn lcd on
gui_settingsMenu(); //enter the settings menu gui_settingsMenu(); //enter the settings menu
saveSettings(); saveSettings();
setCalibrationOffset(systemSettings.CalibrationOffset); setCalibrationOffset(systemSettings.CalibrationOffset); //ensure cal offset is applied
HAL_IWDG_Refresh(&hiwdg);
break; break;
} }
currentlyActiveTemperatureTarget = 0; //ensure tip is off currentlyActiveTemperatureTarget = 0; //ensure tip is off
@@ -722,9 +722,10 @@ void startGUITask(void const * argument) {
if (tempWarningState == 0) { if (tempWarningState == 0) {
currentlyActiveTemperatureTarget = 0; //ensure tip is off currentlyActiveTemperatureTarget = 0; //ensure tip is off
lcd.displayOnOff(true); //force LCD on lcd.displayOnOff(true); //force LCD on
if (gui_showTipTempWarning() == 1) if (gui_showTipTempWarning() == 1) {
gui_solderingMode(); //re-enter into soldering mode if user pressed the front button tempWarningState = 2; //we can re-enter the warning
tempWarningState = 1; } else
tempWarningState = 1;
} }
} else } else
tempWarningState = 0; tempWarningState = 0;
@@ -754,14 +755,15 @@ void startGUITask(void const * argument) {
} else { } else {
lcd.setFont(0); lcd.setFont(0);
if (lcd.getRotation()) {
if (lcd.getRotation())
lcd.drawArea(12, 0, 84, 16, idleScreenBG); lcd.drawArea(12, 0, 84, 16, idleScreenBG);
else lcd.setCursor(0, 0);
lcd.drawArea(12, 0, 84, 16, idleScreenBGF); //Needs to be flipped gui_drawBatteryIcon();
} else {
lcd.setCursor(0, 0); lcd.drawArea(0, 0, 84, 16, idleScreenBGF); //Needs to be flipped
gui_drawBatteryIcon(); lcd.setCursor(84, 0);
gui_drawBatteryIcon();
}
} }