aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2018-04-27 15:25:58 +1000
committerBen V. Brown <[email protected]>2018-04-27 15:25:58 +1000
commit42db57da25a22eca22bed22adac3192d02ca0944 (patch)
treefc97384cd37a60a9f9eb7caf67c27e9e99a2f127
parentb6351f96968b19bd9a2bfa8a418b87d89e155ace (diff)
downloadIronOS-42db57da25a22eca22bed22adac3192d02ca0944.tar.gz
IronOS-42db57da25a22eca22bed22adac3192d02ca0944.zip
Update power indicatorv2.04
Fixes and closes #211 Final 2.04 release coming up :)
-rw-r--r--workspace/TS100/.settings/language.settings.xml2
-rw-r--r--workspace/TS100/inc/Font.h1
-rw-r--r--workspace/TS100/inc/OLED.hpp2
-rw-r--r--workspace/TS100/src/OLED.cpp52
-rw-r--r--workspace/TS100/src/main.cpp14
5 files changed, 55 insertions, 16 deletions
diff --git a/workspace/TS100/.settings/language.settings.xml b/workspace/TS100/.settings/language.settings.xml
index 74f0690e..09c8dae2 100644
--- a/workspace/TS100/.settings/language.settings.xml
+++ b/workspace/TS100/.settings/language.settings.xml
@@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
- <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="1349131645423570210" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+ <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-283880394950776525" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
diff --git a/workspace/TS100/inc/Font.h b/workspace/TS100/inc/Font.h
index 2cc9510f..666e338f 100644
--- a/workspace/TS100/inc/Font.h
+++ b/workspace/TS100/inc/Font.h
@@ -490,7 +490,6 @@ const uint8_t ExtraFontChars[] = {
0x00,0xF0,0x08,0xEE,0xE2,0xFA,0xFA,0xE2,0xEE,0x08,0xF0,0x00,0x00,0x3F,0x40,0x5F,0x5F,0x5F,0x5F,0x5F,0x5F,0x40,0x3F,0x00, // Battery 10*/
0x00,0x00,0x38,0xC4,0x00,0x38,0xC4,0x00,0x38,0xC4,0x00,0x00,0x00,0x38,0x3A,0x39,0x38,0x3A,0x39,0x38,0x3A,0x39,0x10,0x10, // heating
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x10,0x10, // cooling
0x00,0x60,0xE0,0xFE,0xE0,0xE0,0xE0,0xE0,0xFE,0xE0,0x60,0x00,0x00,0x00,0x00,0x01,0x03,0xFF,0xFF,0x03,0x01,0x00,0x00,0x00, // AC
0xFC,0x02,0x02,0x02,0x02,0x02,0x02,0x82,0x62,0x1A,0x02,0xFC,0x3F,0x40,0x42,0x46,0x4C,0x58,0x46,0x41,0x40,0x40,0x40,0x3F, // ☑ (check box on, menu true)
diff --git a/workspace/TS100/inc/OLED.hpp b/workspace/TS100/inc/OLED.hpp
index c76571be..09030bf6 100644
--- a/workspace/TS100/inc/OLED.hpp
+++ b/workspace/TS100/inc/OLED.hpp
@@ -49,6 +49,8 @@ public:
const uint8_t* ptr);
void fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
const uint8_t value);
+ void drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,bool clear);
+ void drawHeatSymbol(uint8_t state);
private:
//Draw a buffer to the screen buffer
diff --git a/workspace/TS100/src/OLED.cpp b/workspace/TS100/src/OLED.cpp
index 25612d70..f4452069 100644
--- a/workspace/TS100/src/OLED.cpp
+++ b/workspace/TS100/src/OLED.cpp
@@ -86,8 +86,8 @@ void OLED::refresh() {
screenBuffer[12] = 0x80;
screenBuffer[13] = 0x01;
screenBuffer[14] = 0x40; //start of data marker
-
- i2c->Transmit( DEVICEADDR_OLED, screenBuffer, 12 + 96 * 2 + 1);
+
+ i2c->Transmit( DEVICEADDR_OLED, screenBuffer, 14 + 96 * 2 + 1);
}
@@ -266,7 +266,7 @@ void OLED::drawBattery(uint8_t state) {
drawSymbol(3 + state);
}
void OLED::drawCheckbox(bool state) {
- drawSymbol((state) ? 17 : 18);
+ drawSymbol((state) ? 16 : 17);
}
void OLED::drawSymbol(uint8_t symbolID) {
//draw a symbol to the current cursor location
@@ -340,3 +340,49 @@ void OLED::fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
}
}
}
+
+void OLED::drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
+ bool clear) {
+ //Draw this in 3 sections
+ //This is basically a N wide version of vertical line
+
+ //Step 1 : Draw in the top few pixels that are not /8 aligned
+ //LSB is at the top of the screen
+ uint8_t mask = 0xFF;
+ if (y0) {
+ mask = mask << (y0 % 8);
+ for (uint8_t col = x0; col < x1; col++)
+ if (clear)
+ firstStripPtr[(y0 / 8) * 96 + col] &= ~mask;
+ else
+ firstStripPtr[(y0 / 8) * 96 + col] |= mask;
+ }
+ //Next loop down the line the total number of solids
+ if (y0 / 8 != y1 / 8)
+ for (uint8_t col = x0; col < x1; col++)
+ for (uint8_t r = (y0 / 8); r < (y1 / 8); r++) {
+ //This gives us the row index r
+ if (clear)
+ firstStripPtr[(r * 96) + col] = 0;
+ else
+ firstStripPtr[(r * 96) + col] = 0xFF;
+ }
+
+ //Finally draw the tail
+ mask = ~(mask << (y1 % 8));
+ for (uint8_t col = x0; col < x1; col++)
+ if (clear)
+ firstStripPtr[(y1 / 8) * 96 + col] &= ~mask;
+ else
+ firstStripPtr[(y1 / 8) * 96 + col] |= mask;
+}
+
+void OLED::drawHeatSymbol(uint8_t state) {
+ //Draw symbol 14
+//Then draw over it botom 5 pixels always stay. 8 pixels above that are the levels
+ state /= 12; // 0-> 8 range
+ //Then we want to draw down (16-(5+state)
+ uint8_t cursor_x_temp = cursor_x;
+ drawSymbol(14);
+ drawFilledRect(cursor_x_temp, 0, cursor_x_temp + 12, 2 + (8 - state), true);
+}
diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp
index d74bee50..5219b8fa 100644
--- a/workspace/TS100/src/main.cpp
+++ b/workspace/TS100/src/main.cpp
@@ -256,7 +256,7 @@ static void gui_drawBatteryIcon() {
cellV = 9;
lcd.drawBattery(cellV + 1);
} else
- lcd.drawSymbol(16); // Draw the DC Logo
+ lcd.drawSymbol(15); // Draw the DC Logo
}
static void gui_solderingTempAdjust() {
uint32_t lastChange = xTaskGetTickCount();
@@ -571,18 +571,10 @@ static void gui_solderingMode() {
lcd.drawChar(' ');
// Draw heating/cooling symbols
- // If tip PWM > 30% then we are 'heating'
- if (getTipPWM() > 30)
- lcd.drawSymbol(14);
- else
- lcd.drawSymbol(15);
+ lcd.drawHeatSymbol(getTipPWM());
} else {
// Draw heating/cooling symbols
- // If tip PWM > 10% then we are 'heating'
- if (getTipPWM() > 10)
- lcd.drawSymbol(14);
- else
- lcd.drawSymbol(15);
+ lcd.drawHeatSymbol(getTipPWM());
// We draw boost arrow if boosting, or else gap temp <-> heat indicator
if (boostModeOn)
lcd.drawSymbol(2);