mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
V1.02 Add Thermometer Mode
This commit is contained in:
@@ -103,7 +103,7 @@
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1113492345" name="Release" parent="fr.ac6.managedbuild.config.gnu.cross.exe.release" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O binary "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.bin"; arm-none-eabi-size -B "${BuildArtifactFileName}"">
|
||||
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1113492345" name="Release" parent="fr.ac6.managedbuild.config.gnu.cross.exe.release" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O binary "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.bin"; arm-none-eabi-size -B "${BuildArtifactFileName}";arm-none-eabi-objcopy -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex"">
|
||||
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1113492345." name="/" resourcePath="">
|
||||
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release.668479481" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release">
|
||||
<option id="fr.ac6.managedbuild.option.gnu.cross.mcu.302274410" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32F103T8Ux" valueType="string"/>
|
||||
|
||||
@@ -24,10 +24,11 @@ enum {
|
||||
SLEEP,
|
||||
COOLING,
|
||||
UVLOWARN,
|
||||
THERMOMETER,
|
||||
} operatingMode;
|
||||
|
||||
enum {
|
||||
UVCO = 0, SLEEP_TEMP, SLEEP_TIME, MOTIONDETECT, TEMPDISPLAY,LEFTY
|
||||
UVCO = 0, SLEEP_TEMP, SLEEP_TIME, MOTIONDETECT, TEMPDISPLAY, LEFTY
|
||||
|
||||
} settingsPage;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void setup() {
|
||||
restoreSettings(); //Load settings
|
||||
if (systemSettings.flipDisplay)
|
||||
Oled_DisplayFlip();
|
||||
OLED_DrawString("VER 1.01",8);
|
||||
OLED_DrawString("VER 1.02",8);
|
||||
delayMs(800);
|
||||
Start_Watchdog(1000); //start the system watchdog as 1 seconds timeout
|
||||
}
|
||||
|
||||
@@ -16,12 +16,16 @@ void ProcessUI() {
|
||||
switch (operatingMode) {
|
||||
case STARTUP:
|
||||
if ((millis() - getLastButtonPress() > 1000)) {
|
||||
if (Buttons & BUT_A) {
|
||||
if (Buttons == (BUT_A | BUT_B)) {
|
||||
operatingMode = THERMOMETER;
|
||||
resetLastButtonPress();
|
||||
resetButtons();
|
||||
} else if (Buttons == BUT_A) {
|
||||
//A key pressed so we are moving to soldering mode
|
||||
operatingMode = SOLDERING;
|
||||
resetLastButtonPress();
|
||||
resetButtons();
|
||||
} else if (Buttons & BUT_B) {
|
||||
} else if (Buttons == BUT_B) {
|
||||
//B Button was pressed so we are moving to the Settings menu
|
||||
operatingMode = SETTINGS;
|
||||
resetLastButtonPress();
|
||||
@@ -174,16 +178,11 @@ void ProcessUI() {
|
||||
operatingMode = STARTUP;
|
||||
resetLastButtonPress();
|
||||
resetButtons();
|
||||
} else { //we check if the user has pushed a button to ack
|
||||
if ((millis() - getLastButtonPress() > 800)
|
||||
&& (millis() - getLastButtonPress() < 5000)) {
|
||||
if (getButtons() & (BUT_A | BUT_B)) {
|
||||
//Either button was pushed
|
||||
operatingMode = STARTUP;
|
||||
resetLastButtonPress();
|
||||
resetButtons();
|
||||
}
|
||||
}
|
||||
} else if (Buttons & (BUT_A | BUT_B)) { //we check if the user has pushed a button to ack
|
||||
//Either button was pushed
|
||||
operatingMode = STARTUP;
|
||||
resetLastButtonPress();
|
||||
resetButtons();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -194,6 +193,17 @@ void ProcessUI() {
|
||||
operatingMode = STARTUP; //jump back to idle mode
|
||||
}
|
||||
break;
|
||||
case THERMOMETER: {
|
||||
//This lets the user check the tip temp without heating the iron.. And eventually calibration will be added here
|
||||
if ((millis() - getLastButtonPress() > 1000))
|
||||
if (Buttons == (BUT_A | BUT_B)) {
|
||||
//If the user is holding both button, exit the temp screen
|
||||
operatingMode = STARTUP;
|
||||
resetLastButtonPress();
|
||||
resetButtons();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -231,7 +241,7 @@ void DrawUI() {
|
||||
if (getIronTimer() == 0) {
|
||||
OLED_DrawChar('C', 5);
|
||||
} else {
|
||||
if (getIronTimer() < 500) {
|
||||
if (getIronTimer() < 900) {
|
||||
OLED_DrawChar(' ', 5);
|
||||
} else { //we are heating
|
||||
OLED_DrawChar('H', 5);
|
||||
@@ -302,16 +312,20 @@ void DrawUI() {
|
||||
//The iron is in sleep temp mode
|
||||
//Draw in temp and sleep
|
||||
OLED_DrawString("SLP", 3);
|
||||
drawTemp(temp, 3);
|
||||
drawTemp(temp, 4);
|
||||
break;
|
||||
case COOLING:
|
||||
//We are warning the user the tip is cooling
|
||||
OLED_DrawString("COOL", 4);
|
||||
drawTemp(temp, 4);
|
||||
drawTemp(temp, 5);
|
||||
break;
|
||||
case UVLOWARN:
|
||||
OLED_DrawString("LOW VOLT", 8);
|
||||
break;
|
||||
case THERMOMETER:
|
||||
OLED_DrawString("TEMP ", 5);//extra one to it clears the leftover 'L' from IDLE
|
||||
drawTemp(temp, 5);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user