Skip to content

Commit

Permalink
V1.02 Add Thermometer Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralim committed Jan 23, 2017
1 parent b7e4249 commit b2db129
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
2 changes: 1 addition & 1 deletion workspace/ts100/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -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 &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.bin&quot;; arm-none-eabi-size -B &quot;${BuildArtifactFileName}&quot;">
<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 &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.bin&quot;; arm-none-eabi-size -B &quot;${BuildArtifactFileName}&quot;;arm-none-eabi-objcopy -O ihex &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.hex&quot;">
<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"/>
Expand Down
3 changes: 2 additions & 1 deletion workspace/ts100/inc/Modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion workspace/ts100/src/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
44 changes: 29 additions & 15 deletions workspace/ts100/src/Modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b2db129

Please sign in to comment.