1
0
forked from me/IronOS

add vSense lockout

This commit is contained in:
Ben V. Brown
2018-11-20 20:28:30 +11:00
parent 6a1572de81
commit fff0ed7581
2 changed files with 32 additions and 19 deletions

View File

@@ -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) {

View File

@@ -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