From 965a0890cb760a9a4dea1e35329c8beced6da45e Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Wed, 26 Jul 2017 09:47:26 +1000 Subject: [PATCH] Add toggle for power display --- workspace/ts100/inc/Modes.h | 3 ++- workspace/ts100/src/Modes.c | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/workspace/ts100/inc/Modes.h b/workspace/ts100/inc/Modes.h index 9a24b328..432b0ab2 100644 --- a/workspace/ts100/inc/Modes.h +++ b/workspace/ts100/inc/Modes.h @@ -30,7 +30,7 @@ typedef enum { TEMPCAL, //Cal tip temp offset } operatingModeEnum; -#define SETTINGSOPTIONSCOUNT 10 /*Number of settings in the settings menu*/ +#define SETTINGSOPTIONSCOUNT 11 /*Number of settings in the settings menu*/ typedef enum { UVCO = 0, @@ -44,6 +44,7 @@ typedef enum { LEFTY, BOOSTMODE, BOOSTTEMP, + POWERDISPLAY, } settingsPageEnum; void ProcessUI(); diff --git a/workspace/ts100/src/Modes.c b/workspace/ts100/src/Modes.c index 1c30efb4..7aff2022 100644 --- a/workspace/ts100/src/Modes.c +++ b/workspace/ts100/src/Modes.c @@ -14,7 +14,8 @@ const char *SettingsLongNames[] = { " Temperature Display Update Rate", " Flip Display for Left Hand", " Enable front key boost 450C mode when soldering", - " Temperature when in boost mode" }; + " Temperature when in boost mode", + " Changes the arrows to a power display when soldering" }; uint8_t StatusFlags = 0; uint32_t temporaryTempStorage = 0; @@ -225,6 +226,9 @@ void ProcessUI() { if (systemSettings.BoostTemp > 4500) systemSettings.BoostTemp = 2500; //loop back at 250 break; + case POWERDISPLAY: + systemSettings.powerDisplay = !systemSettings.powerDisplay; + break; default: break; } @@ -469,7 +473,7 @@ void DrawUI() { //Optionally draw the arrows, or draw the power instead if (systemSettings.powerDisplay) { //We want to draw in a neat little bar graph of power being pushed to the tip - Oled_DrawArea(6 * 12, 0, 12, 8, 0); + } else { //Draw in the arrows if the user has the power display turned off OLED_BlankSlot(6 * 12 + 16, 24 - 16);//blank out the tail after the arrows @@ -616,6 +620,16 @@ void DrawUI() { OLED_DrawString("BTMP ", 5); OLED_DrawThreeNumber(systemSettings.BoostTemp / 10, 5); break; + case POWERDISPLAY: + switch (systemSettings.powerDisplay) { + case 1: + OLED_DrawString("PWRDSP T", 8); + break; + case 0: + OLED_DrawString("PWRDSP F", 8); + break; + } + break; default: break; }