From fff0ed7581254296fc841d56b1439754972f3040 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 20 Nov 2018 20:28:30 +1100 Subject: [PATCH] add vSense lockout --- workspace/TS100/src/main.cpp | 41 ++++++++++--------- .../org.eclipse.cdt.managedbuilder.core.prefs | 10 +++++ 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp index 52ad5047..d6bf5df7 100644 --- a/workspace/TS100/src/main.cpp +++ b/workspace/TS100/src/main.cpp @@ -232,26 +232,29 @@ void waitForButtonPressOrTimeout(uint32_t timeout) { // returns true if undervoltage has occured static bool checkVoltageForExit() { uint16_t v = getInputVoltageX10(systemSettings.voltageDiv); - if ((v < lookupVoltageLevel(systemSettings.cutoutSetting))) { - OLED::clearScreen(); - OLED::setCursor(0, 0); - if (systemSettings.detailedSoldering) { - OLED::setFont(1); - OLED::print(UndervoltageString); - OLED::setCursor(0, 8); - OLED::print(InputVoltageString); - printVoltage(); - OLED::print("V"); + //Dont check for first 1.5 seconds while the ADC stabilizes and the DMA fills the buffer + if(xTaskGetTickCount()>150) { + if ((v < lookupVoltageLevel(systemSettings.cutoutSetting))) { + OLED::clearScreen(); + OLED::setCursor(0, 0); + if (systemSettings.detailedSoldering) { + OLED::setFont(1); + OLED::print(UndervoltageString); + OLED::setCursor(0, 8); + OLED::print(InputVoltageString); + printVoltage(); + OLED::print("V"); - } else { - OLED::setFont(0); - OLED::print(UVLOWarningString); + } else { + OLED::setFont(0); + OLED::print(UVLOWarningString); + } + + OLED::refresh(); + currentlyActiveTemperatureTarget = 0; + waitForButtonPress(); + return true; } - - OLED::refresh(); - currentlyActiveTemperatureTarget = 0; - waitForButtonPress(); - return true; } return false; } @@ -1011,7 +1014,7 @@ void startPIDTask(void const *argument __unused) { if (xTaskGetTickCount() - lastPowerPulse < 20) { // for the first 200mS turn on for a bit setTipMilliWatts(4000); // typically its around 5W to hold the current temp, so this wont raise temp much - }else + } else setTipMilliWatts(0); //Then wait until the next second if (xTaskGetTickCount() - lastPowerPulse > 100) { diff --git a/workspace/TS100A/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/workspace/TS100A/.settings/org.eclipse.cdt.managedbuilder.core.prefs index f62ec69c..ec2ba202 100644 --- a/workspace/TS100A/.settings/org.eclipse.cdt.managedbuilder.core.prefs +++ b/workspace/TS100A/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -1,10 +1,20 @@ eclipse.preferences.version=1 +environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419.2005314669/CPATH/delimiter=; +environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419.2005314669/CPATH/operation=remove +environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419.2005314669/C_INCLUDE_PATH/delimiter=; +environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419.2005314669/C_INCLUDE_PATH/operation=remove +environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419.2005314669/append=true +environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419.2005314669/appendContributed=true environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419/CPATH/delimiter=; environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419/CPATH/operation=remove environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419/C_INCLUDE_PATH/delimiter=; environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419/C_INCLUDE_PATH/operation=remove environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419/append=true environment/buildEnvironmentInclude/com.atollic.truestudio.configuration.release.200032419/appendContributed=true +environment/buildEnvironmentLibrary/com.atollic.truestudio.configuration.release.200032419.2005314669/LIBRARY_PATH/delimiter=; +environment/buildEnvironmentLibrary/com.atollic.truestudio.configuration.release.200032419.2005314669/LIBRARY_PATH/operation=remove +environment/buildEnvironmentLibrary/com.atollic.truestudio.configuration.release.200032419.2005314669/append=true +environment/buildEnvironmentLibrary/com.atollic.truestudio.configuration.release.200032419.2005314669/appendContributed=true environment/buildEnvironmentLibrary/com.atollic.truestudio.configuration.release.200032419/LIBRARY_PATH/delimiter=; environment/buildEnvironmentLibrary/com.atollic.truestudio.configuration.release.200032419/LIBRARY_PATH/operation=remove environment/buildEnvironmentLibrary/com.atollic.truestudio.configuration.release.200032419/append=true