From add8993da55f0dc7860102c35eff64782673d47e Mon Sep 17 00:00:00 2001 From: Patrick Horlebein Date: Thu, 16 Apr 2020 11:16:17 +0200 Subject: [PATCH] Use tabs instead of spaces. --- workspace/TS100/Core/Inc/OLED.hpp | 2 +- workspace/TS100/Core/Src/OLED.cpp | 24 ++++++++++++------------ workspace/TS100/Core/Src/gui.cpp | 22 +++++++++++----------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/workspace/TS100/Core/Inc/OLED.hpp b/workspace/TS100/Core/Inc/OLED.hpp index 23a2fd8e..f65216c0 100644 --- a/workspace/TS100/Core/Inc/OLED.hpp +++ b/workspace/TS100/Core/Inc/OLED.hpp @@ -100,7 +100,7 @@ public: static void drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool clear); static void drawHeatSymbol(uint8_t state); - static void drawScrollIndicator(uint8_t p, uint8_t h); // Draws a scrolling position indicator + static void drawScrollIndicator(uint8_t p, uint8_t h); // Draws a scrolling position indicator private: static void drawChar(char c); // Draw a character to a specific location static const uint8_t* currentFont;// Pointer to the current font used for rendering to the buffer diff --git a/workspace/TS100/Core/Src/OLED.cpp b/workspace/TS100/Core/Src/OLED.cpp index ec9fa9ce..31c5f38b 100644 --- a/workspace/TS100/Core/Src/OLED.cpp +++ b/workspace/TS100/Core/Src/OLED.cpp @@ -111,18 +111,18 @@ void OLED::drawChar(char c) { * of the indicator in pixels (0..<16). */ void OLED::drawScrollIndicator(uint8_t y, uint8_t height) { - union u_type { - uint16_t whole; - uint8_t strips[2]; - } column; - - column.whole = (1 << height) - 1; - column.whole <<= y; - - // Draw a one pixel wide bar to the left with a single pixel as - // the scroll indicator. - fillArea(OLED_WIDTH - 1, 0, 1, 8, column.strips[0]); - fillArea(OLED_WIDTH - 1, 8, 1, 8, column.strips[1]); + union u_type { + uint16_t whole; + uint8_t strips[2]; + } column; + + column.whole = (1 << height) - 1; + column.whole <<= y; + + // Draw a one pixel wide bar to the left with a single pixel as + // the scroll indicator. + fillArea(OLED_WIDTH - 1, 0, 1, 8, column.strips[0]); + fillArea(OLED_WIDTH - 1, 8, 1, 8, column.strips[1]); } void OLED::setRotation(bool leftHanded) { diff --git a/workspace/TS100/Core/Src/gui.cpp b/workspace/TS100/Core/Src/gui.cpp index 793cc2bd..afa063d2 100644 --- a/workspace/TS100/Core/Src/gui.cpp +++ b/workspace/TS100/Core/Src/gui.cpp @@ -264,8 +264,8 @@ static void printShortDescription(uint32_t shortDescIndex, // prepare cursor for value OLED::setFont(0); OLED::setCharCursor(cursorCharPosition, 0); - // make room for scroll indicator - OLED::setCursor(OLED::getCursorX() - 2, 0); + // make room for scroll indicator + OLED::setCursor(OLED::getCursorX() - 2, 0); } static int userConfirmation(const char *message) { @@ -784,7 +784,7 @@ static void displayMenu(size_t index) { OLED::print(SettingsMenuEntries[index]); // Draw symbol // 16 pixel wide image - // 2 pixel wide scrolling indicator + // 2 pixel wide scrolling indicator OLED::drawArea(96 - 16 - 2, 0, 16, 16, (&SettingsMenuIcons[(16 * 2) * index])); } @@ -826,11 +826,11 @@ void gui_Menu(const menuitem *menu) { int16_t lastOffset = -1; bool lcdRefresh = true; ButtonState lastButtonState = BUTTON_NONE; - uint8_t scrollContentSize = 0; - - for (uint8_t i = 0; menu[i].draw.func != NULL; i++) { - scrollContentSize += 1; - } + uint8_t scrollContentSize = 0; + + for (uint8_t i = 0; menu[i].draw.func != NULL; i++) { + scrollContentSize += 1; + } while ((menu[currentScreen].draw.func != NULL) && earlyExit == false) { OLED::setFont(0); @@ -841,9 +841,9 @@ void gui_Menu(const menuitem *menu) { || menu[currentScreen].description == NULL) { OLED::clearScreen(); menu[currentScreen].draw.func(); - uint8_t indicatorHeight = OLED_HEIGHT / scrollContentSize; - uint8_t position = currentScreen * indicatorHeight; - OLED::drawScrollIndicator(position, indicatorHeight); + uint8_t indicatorHeight = OLED_HEIGHT / scrollContentSize; + uint8_t position = currentScreen * indicatorHeight; + OLED::drawScrollIndicator(position, indicatorHeight); lastOffset = -1; lcdRefresh = true; } else {