From cb5d4bc49d9272bccc6bb2eb16f96a84380f7145 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sun, 21 May 2017 23:50:20 +1000 Subject: [PATCH] Import up/down indicator from miniware Closes #3 with nicer heating display --- workspace/ts100/inc/Font.h | 26 ++++++++++++++++++++++++++ workspace/ts100/inc/Oled.h | 2 ++ workspace/ts100/src/Main.c | 2 +- workspace/ts100/src/Modes.c | 34 ++++++++++++++++++---------------- workspace/ts100/src/Oled.c | 12 ++++++++++++ 5 files changed, 59 insertions(+), 17 deletions(-) diff --git a/workspace/ts100/inc/Font.h b/workspace/ts100/inc/Font.h index 486b98364e..f95590ab0b 100644 --- a/workspace/ts100/inc/Font.h +++ b/workspace/ts100/inc/Font.h @@ -163,4 +163,30 @@ const uint8_t Iron_RightArrow_DOWN[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; +const uint8_t SymbolTable[]={ + + 0x0E,0x11,0x11,0x0E,0xE0,0xF8,0x0C,0x06,0x03,0x01,0x01,0x01,0x01,0x02,0x1E,0x00, + 0x00,0x00,0x00,0x00,0x0F,0x3F,0x70,0xC0,0x80,0x80,0x80,0x80,0x80,0x40,0x20,0x00, // Degrees C + + 0x08,0x14,0x22,0x14,0x08,0x02,0x02,0xFE,0x06,0x02,0x02,0x02,0xC2,0x02,0x06,0x1E, + 0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0x81,0x81,0x01,0x01,0x03,0x00,0x00,0x00, // Degrees F + + 0xC0,0x30,0x08,0x04,0x04,0x02,0xFA,0xAA,0xFA,0x02,0x04,0x04,0x08,0x30,0xC0,0x00, + 0x07,0x18,0x20,0x40,0x58,0xA4,0xDB,0xDE,0xDB,0xA4,0x58,0x40,0x20,0x18,0x07,0x00, // Temp symbol + + 0x00,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0xF0,0x00,0x00,0xFC,0xF8,0xF0,0xE0,0xC0,0x80, //Right Arrow + 0x00,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x0F,0x00,0x00,0x3F,0x1F,0x0F,0x07,0x03,0x01, + + 0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0x00,0x00,0xF0,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0x00, //Left Arrow + 0x01,0x03,0x07,0x0F,0x1F,0x3F,0x00,0x00,0x0F,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00, + + 0x11,0x33,0x66,0xCC,0x98,0x30,0x60,0xC0,0xC0,0x60,0x30,0x98,0xCC,0x66,0x33,0x11, + 0x01,0x03,0x06,0x0C,0x19,0x33,0x66,0xCC,0xCC,0x66,0x33,0x19,0x0C,0x06,0x03,0x01, //Down Chevron + + 0x80,0xC0,0x60,0x30,0x98,0xCC,0x66,0x33,0x33,0x66,0xCC,0x98,0x30,0x60,0xC0,0x80, + 0x88,0xCC,0x66,0x33,0x19,0x0C,0x06,0x03,0x03,0x06,0x0C,0x19,0x33,0x66,0xCC,0x88, //Up Chevron + + 0x00,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x00, // Flat Lines + 0x00,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x00, +}; #endif /* FONT_H_ */ diff --git a/workspace/ts100/inc/Oled.h b/workspace/ts100/inc/Oled.h index c46ba62821..682faa6ed3 100644 --- a/workspace/ts100/inc/Oled.h +++ b/workspace/ts100/inc/Oled.h @@ -25,7 +25,9 @@ void Clear_Screen(void);//Clear the screen void OLED_DrawString(char* string, uint8_t length); void OLED_DrawChar(char c, uint8_t x); void OLED_DrawTwoNumber(uint8_t in, uint8_t x); +void OLED_BlankSlot(uint8_t xStart,uint8_t width); void OLED_DrawThreeNumber(uint16_t in, uint8_t x); void OLED_DrawIDLELogo(); +void OLED_DrawSymbol(uint8_t x,uint8_t symbol); #endif /******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/src/Main.c b/workspace/ts100/src/Main.c index a28b9ca8cf..1768e0c5fb 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.05", 8); // + OLED_DrawString("VER 1.06", 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 bb5cc1f8d0..db1c64f2d1 100644 --- a/workspace/ts100/src/Modes.c +++ b/workspace/ts100/src/Modes.c @@ -281,41 +281,43 @@ void DrawUI() { Oled_DisplayOff(); } else { Oled_DisplayOn(); - //OLED_DrawString(" IDLE ", 8); //write the word IDLE - OLED_DrawIDLELogo(); + OLED_DrawIDLELogo(); //Draw the icons for prompting the user } break; case SOLDERING: //The user is soldering { + drawTemp(temp, 0); + 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_DrawChar('C', 5); + OLED_DrawSymbol(6, 5); } else { if (getIronTimer() < 900) { - OLED_DrawChar(' ', 5); + OLED_DrawSymbol(6, 7); } else { //we are heating - OLED_DrawChar('H', 5); + //OLED_DrawChar('H', 5); + OLED_DrawSymbol(6, 6); } } - drawTemp(temp, 0); - OLED_DrawChar(' ', 3); - OLED_DrawChar(' ', 4); - OLED_DrawChar(' ', 6); - OLED_DrawChar(' ', 7); - + if (systemSettings.displayTempInF) { + OLED_DrawSymbol(4, 1); + } else { + OLED_DrawSymbol(4, 0); + } } break; case TEMP_ADJ: //We are prompting the user to change the temp so we draw the current setpoint temp //With the nifty arrows - OLED_DrawChar(' ', 0); OLED_DrawChar('<', 1); drawTemp(systemSettings.SolderingTemp, 2); OLED_DrawChar(' ', 5); - OLED_DrawChar(' ', 6); - OLED_DrawChar('>', 7); - + OLED_DrawChar(' ', 7); + OLED_DrawChar('>', 6); break; case SETTINGS: //We are prompting the user the setting name @@ -383,7 +385,7 @@ void DrawUI() { break; case COOLING: //We are warning the user the tip is cooling - OLED_DrawString("COOL", 4); + OLED_DrawString("COOL ", 5); drawTemp(temp, 5); break; case UVLOWARN: diff --git a/workspace/ts100/src/Oled.c b/workspace/ts100/src/Oled.c index db9526504a..88e98be100 100644 --- a/workspace/ts100/src/Oled.c +++ b/workspace/ts100/src/Oled.c @@ -207,6 +207,14 @@ void OLED_DrawChar(char c, uint8_t x) { Oled_DrawArea(x, 0, FONT_WIDTH, 16, (u8*) ptr); } + +void OLED_BlankSlot(uint8_t xStart, uint8_t width) { + u8* ptr = (u8*) FONT; + ptr += (36) * (FONT_WIDTH * 2); + + Oled_DrawArea(xStart, 0, width, 16, (u8*) ptr); +} + /* * Draw a 2 digit number to the display at letter slot x */ @@ -254,3 +262,7 @@ void OLED_DrawIDLELogo() { } } + +void OLED_DrawSymbol(uint8_t x, uint8_t symbol) { + Oled_DrawArea(x * FONT_WIDTH, 0, 16, 16, SymbolTable + (symbol * 32)); +}