From b47098e9c25dd13c53a85c5a8257794775ad04ab Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 26 Jan 2018 12:50:00 +1100 Subject: [PATCH] Add lockout for #187 Fix first part of #188 --- workspace/TS100/src/main.cpp | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp index 9e4394d9..7231f30a 100644 --- a/workspace/TS100/src/main.cpp +++ b/workspace/TS100/src/main.cpp @@ -692,6 +692,19 @@ void startGUITask(void const *argument) { uint8_t tempWarningState = 0; HAL_IWDG_Refresh(&hiwdg); + switch (systemSettings.OrientationMode) { + case 0: + lcd.setRotation(false); + break; + case 1: + lcd.setRotation(true); + break; + case 2: + lcd.setRotation(false); + break; + default: + break; + } if (showBootLogoIfavailable()) waitForButtonPressOrTimeout(2000); HAL_IWDG_Refresh(&hiwdg); @@ -756,17 +769,17 @@ void startGUITask(void const *argument) { break; } currentlyActiveTemperatureTarget = 0; // ensure tip is off - - if (systemSettings.sensitivity) { - if ((HAL_GetTick() - lastMovementTime) > 60000 - && (HAL_GetTick() - lastButtonTime) > 60000) - lcd.displayOnOff(false); // turn lcd off when no movement - else if (HAL_GetTick() - lastMovementTime < 1000 - || HAL_GetTick() - lastButtonTime < 1000) /*Use short time for test, and prevent lots of I2C - writes for no need*/ - lcd.displayOnOff(true); // turn lcd back on - } uint16_t tipTemp = tipMeasurementToC(getTipRawTemp(0)); + if (tipTemp > 50) + if (systemSettings.sensitivity) { + if ((HAL_GetTick() - lastMovementTime) > 60000 + && (HAL_GetTick() - lastButtonTime) > 60000) + lcd.displayOnOff(false); // turn lcd off when no movement + else if (HAL_GetTick() - lastMovementTime < 1000 + || HAL_GetTick() - lastButtonTime < 1000) /*Use short time for test, and prevent lots of I2C + writes for no need*/ + lcd.displayOnOff(true); // turn lcd back on + } if (tipTemp > 600) tipTemp = 0; if (tipTemp > 50) {