aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2017-07-07 19:20:52 +1000
committerBen V. Brown <[email protected]>2017-07-07 19:20:52 +1000
commitf3156e88dc54d88f6419852856eabcb33e920002 (patch)
tree229c9f862dd9a9db2c0671f7e0191b8bbde5ad48
parent13603d8db6282590a88d3297feca5a3cb24dea6b (diff)
downloadIronOS-f3156e88dc54d88f6419852856eabcb33e920002.tar.gz
IronOS-f3156e88dc54d88f6419852856eabcb33e920002.zip
V1.09 - Add display update mode
Adds the following modes for display update: Fast (old style) Slow (1Hz) Rounded (Only shows to 10C increments) None (No temp, just symbol)
-rw-r--r--workspace/ts100/inc/Modes.h2
-rw-r--r--workspace/ts100/inc/Settings.h14
-rw-r--r--workspace/ts100/src/Main.c2
-rw-r--r--workspace/ts100/src/Modes.c62
-rw-r--r--workspace/ts100/ts100.xml2
5 files changed, 66 insertions, 16 deletions
diff --git a/workspace/ts100/inc/Modes.h b/workspace/ts100/inc/Modes.h
index 63478c7b..b8f0a2cf 100644
--- a/workspace/ts100/inc/Modes.h
+++ b/workspace/ts100/inc/Modes.h
@@ -29,6 +29,7 @@ enum {
TEMPCAL, //Cal tip temp offset
} operatingMode;
+#define SETTINGSOPTIONSCOUNT 8 /*Number of settings in the settings menu*/
enum {
UVCO = 0,
@@ -38,6 +39,7 @@ enum {
MOTIONDETECT,
MOTIONSENSITIVITY,
TEMPDISPLAY,
+ DISPLAYMODE,
LEFTY,
} settingsPage;
diff --git a/workspace/ts100/inc/Settings.h b/workspace/ts100/inc/Settings.h
index 35325d34..13cf1897 100644
--- a/workspace/ts100/inc/Settings.h
+++ b/workspace/ts100/inc/Settings.h
@@ -11,11 +11,14 @@
#define SETTINGS_H_
#include <stdint.h>
#include "stm32f10x_flash.h"
-#define SETTINGSVERSION 0x05 /*Change this if you change the struct below to prevent people getting out of sync*/
-#define SETTINGSOPTIONSCOUNT 7 /*Number of settings in the settings menu*/
-#define MOTION_HIGH (0x00)
-#define MOTION_MED (0x10)
-#define MOTION_LOW (0x20)
+#define SETTINGSVERSION 0x06 /*Change this if you change the struct below to prevent people getting out of sync*/
+#define MOTION_HIGH (0x00)
+#define MOTION_MED (0x10)
+#define MOTION_LOW (0x20)
+#define DISPLAYMODE_FAST (0x00)
+#define DISPLAYMODE_SLOW (0x01)
+#define DISPLAYMODE_ROUND (0x02)
+#define DISPLAYMODE_NONE (0x03)
/*
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
*/
@@ -30,6 +33,7 @@ struct {
uint8_t flipDisplay:1; //If true we want to invert the display for lefties
uint8_t sensitivity:7; //Sensitivity of accelerometer
uint8_t ShutdownTime:7; //Time until unit shuts down if left alone
+ uint8_t displayUpdateMode:2; //How fast the display updates / temp showing mode
uint16_t tempCalibration; //Temperature calibration value
uint16_t voltageDiv; //Voltage divisor factor
} systemSettings;
diff --git a/workspace/ts100/src/Main.c b/workspace/ts100/src/Main.c
index e96edbf8..aac45ef4 100644
--- a/workspace/ts100/src/Main.c
+++ b/workspace/ts100/src/Main.c
@@ -37,7 +37,7 @@ void setup() {
readIronTemp(systemSettings.tempCalibration, 0,0); //load the default calibration value
Init_Oled(systemSettings.flipDisplay); //Init the OLED display
- OLED_DrawString("VER 1.08", 8); //
+ OLED_DrawString("VER 1.09", 8); //
delayMs(800); //Pause to show version number
Start_Watchdog(1000); //start the system watch dog as 1 second timeout
}
diff --git a/workspace/ts100/src/Modes.c b/workspace/ts100/src/Modes.c
index 429423a7..944effa5 100644
--- a/workspace/ts100/src/Modes.c
+++ b/workspace/ts100/src/Modes.c
@@ -93,8 +93,10 @@ void ProcessUI() {
settingsPage = 0; //reset
operatingMode = STARTUP; //reset back to the startup
saveSettings(); //Save the settings
- } else
+ } else {
++settingsPage; //move to the next option
+
+ }
} else if (Buttons & BUT_B) {
resetLastButtonPress();
//B changes the value selected
@@ -124,6 +126,7 @@ void ProcessUI() {
case MOTIONDETECT:
systemSettings.movementEnabled =
!systemSettings.movementEnabled;
+
break;
case TEMPDISPLAY:
systemSettings.displayTempInF = !systemSettings.displayTempInF;
@@ -132,11 +135,17 @@ void ProcessUI() {
systemSettings.flipDisplay = !systemSettings.flipDisplay;
break;
case MOTIONSENSITIVITY:
+
systemSettings.sensitivity += 0x10;
if (systemSettings.sensitivity > 0x20)
systemSettings.sensitivity = 0; //reset to high on wrap
break;
+ case DISPLAYMODE:
+ systemSettings.displayUpdateMode++;
+ systemSettings.displayUpdateMode =
+ systemSettings.displayUpdateMode % 4;
+ break;
default:
break;
}
@@ -288,6 +297,7 @@ void drawTemp(uint16_t temp, uint8_t x) {
* Performs all the OLED drawing for the current operating mode
*/
void DrawUI() {
+ static uint32_t lastSolderingDrawTime = 0;
uint16_t temp = readIronTemp(0, 0, 0xFFFF);
switch (operatingMode) {
case STARTUP:
@@ -305,26 +315,42 @@ void DrawUI() {
case SOLDERING:
//The user is soldering
{
- drawTemp(temp, 0);
- OLED_DrawChar(' ', 3);
+ if (systemSettings.displayUpdateMode == DISPLAYMODE_FAST
+ || (systemSettings.displayUpdateMode == DISPLAYMODE_SLOW
+ && (millis() - lastSolderingDrawTime > 1000))) {
+ drawTemp(temp, 0);
+ } else if (systemSettings.displayUpdateMode == DISPLAYMODE_ROUND) {
+ drawTemp((temp / 100) * 100, 0);
+ } else if (systemSettings.displayUpdateMode == DISPLAYMODE_NONE) {
+ OLED_DrawChar(' ', 0);
+ OLED_DrawChar(' ', 1);
+ OLED_DrawChar(' ', 2);
+ }
+ //Now draw symbols
+ OLED_DrawChar(' ', 3);
OLED_BlankSlot(6 * 12 + 16, 24 - 16);//blank out the tail after the arrows
OLED_BlankSlot(4 * 12 + 16, 24 - 16);//blank out the tail after the temp
if (getIronTimer() == 0) {
OLED_DrawSymbol(6, 5);
} else {
- if (getIronTimer() < 900) {
+ if (getIronTimer() < 1000) {
OLED_DrawSymbol(6, 7);
} else { //we are heating
- //OLED_DrawChar('H', 5);
OLED_DrawSymbol(6, 6);
}
}
- if (systemSettings.displayTempInF) {
- OLED_DrawSymbol(4, 1);
+ if (!(systemSettings.displayUpdateMode == DISPLAYMODE_NONE)) {
+ if (systemSettings.displayTempInF) {
+ OLED_DrawSymbol(4, 1);
+ } else {
+ OLED_DrawSymbol(4, 0);
+ }
} else {
- OLED_DrawSymbol(4, 0);
+ OLED_DrawChar(' ', 4);
+ OLED_DrawChar(' ', 5);
}
+
}
break;
case TEMP_ADJ:
@@ -395,7 +421,25 @@ void DrawUI() {
}
break;
-
+ case DISPLAYMODE:
+ //We are prompting the user about their display mode preferences
+ {
+ switch (systemSettings.displayUpdateMode) {
+ case DISPLAYMODE_FAST:
+ OLED_DrawString("DISPMD F", 8);
+ break;
+ case DISPLAYMODE_SLOW:
+ OLED_DrawString("DISPMD S", 8);
+ break;
+ case DISPLAYMODE_ROUND:
+ OLED_DrawString("DISPMD R", 8);
+ break;
+ case DISPLAYMODE_NONE:
+ OLED_DrawString("DISPMD N", 8);
+ break;
+ }
+ }
+ break;
default:
break;
}
diff --git a/workspace/ts100/ts100.xml b/workspace/ts100/ts100.xml
index c6c910b0..c610a25d 100644
--- a/workspace/ts100/ts100.xml
+++ b/workspace/ts100/ts100.xml
@@ -4,6 +4,6 @@
<name>ts100</name>
<mcuId>stm32f103t8ux</mcuId>
<dbgIF>SWD</dbgIF>
- <dbgDEV>ST-LinkV2</dbgDEV>
+ <dbgDEV>ST-Link</dbgDEV>
</board>
</targetDefinitions>