Merge pull request #538 from Ralim/fix-temp-symbol

Fix the temp symbol to be used in soldering mode
This commit is contained in:
Ben V. Brown
2019-12-29 16:46:40 +11:00
committed by GitHub
3 changed files with 134 additions and 116 deletions

View File

@@ -69,6 +69,7 @@ public:
cursor_y = y * fontHeight; cursor_y = y * fontHeight;
} }
static void setFont(uint8_t fontNumber); // (Future) Set the font that is being used static void setFont(uint8_t fontNumber); // (Future) Set the font that is being used
static uint8_t getFont();
static void drawImage(const uint8_t* buffer, uint8_t x, uint8_t width) { static void drawImage(const uint8_t* buffer, uint8_t x, uint8_t width) {
drawArea(x, 0, width, 16, buffer); drawArea(x, 0, width, 16, buffer);
} }

View File

@@ -63,10 +63,19 @@ void gui_drawTipTemp(bool symbol) {
OLED::printNumber(Temp, 3); // Draw the tip temp out finally OLED::printNumber(Temp, 3); // Draw the tip temp out finally
if (symbol) { if (symbol) {
if (systemSettings.temperatureInF) if (OLED::getFont() == 0) {
OLED::print(SymbolDegF); //Big font, can draw nice symbols
else if (systemSettings.temperatureInF)
OLED::print(SymbolDegC); OLED::drawSymbol(0);
else
OLED::drawSymbol(1);
} else {
//Otherwise fall back to chars
if (systemSettings.temperatureInF)
OLED::print(SymbolDegF);
else
OLED::print(SymbolDegC);
}
} }
} }
ButtonState getButtonState() { ButtonState getButtonState() {

View File

@@ -155,6 +155,14 @@ void OLED::setFont(uint8_t fontNumber) {
fontWidth = 12; fontWidth = 12;
} }
} }
uint8_t OLED::getFont() {
if (currentFont == USER_FONT_6x8)
return 1;
else if (currentFont == ExtraFontChars)
return 2;
else
return 0;
}
inline void stripLeaderZeros(char *buffer) { inline void stripLeaderZeros(char *buffer) {
//Removing the leading zero's by swapping them to SymbolSpace //Removing the leading zero's by swapping them to SymbolSpace
// Stop 1 short so that we dont blank entire number if its zero // Stop 1 short so that we dont blank entire number if its zero