diff options
author | Ben V. Brown <[email protected]> | 2017-01-23 19:33:03 +1100 |
---|---|---|
committer | Ben V. Brown <[email protected]> | 2017-01-23 19:33:03 +1100 |
commit | b2db129ab813627e58eaa5fbcbde0e8b27247ad0 (patch) | |
tree | 3672d330b27739648d8f40f66294793d9b2e519c | |
parent | b7e4249d2ef34d63bb1108ce5e84681b7688f89f (diff) | |
download | IronOS-b2db129ab813627e58eaa5fbcbde0e8b27247ad0.tar.gz IronOS-b2db129ab813627e58eaa5fbcbde0e8b27247ad0.zip |
V1.02 Add Thermometer Mode
-rw-r--r-- | workspace/ts100/.cproject | 2 | ||||
-rw-r--r-- | workspace/ts100/inc/Modes.h | 3 | ||||
-rw-r--r-- | workspace/ts100/src/Main.c | 2 | ||||
-rw-r--r-- | workspace/ts100/src/Modes.c | 44 |
4 files changed, 33 insertions, 18 deletions
diff --git a/workspace/ts100/.cproject b/workspace/ts100/.cproject index e6af6223..331cce44 100644 --- a/workspace/ts100/.cproject +++ b/workspace/ts100/.cproject @@ -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"/> diff --git a/workspace/ts100/inc/Modes.h b/workspace/ts100/inc/Modes.h index 38a97211..9c44d5df 100644 --- a/workspace/ts100/inc/Modes.h +++ b/workspace/ts100/inc/Modes.h @@ -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; diff --git a/workspace/ts100/src/Main.c b/workspace/ts100/src/Main.c index c898c3ab..377d921d 100644 --- a/workspace/ts100/src/Main.c +++ b/workspace/ts100/src/Main.c @@ -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
}
diff --git a/workspace/ts100/src/Modes.c b/workspace/ts100/src/Modes.c index b3f56a0d..7e93e981 100644 --- a/workspace/ts100/src/Modes.c +++ b/workspace/ts100/src/Modes.c @@ -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; } |