Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvught committed May 19, 2023
1 parent e991093 commit d0b2e0c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib-display/include/i2c/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <cassert>

#include "displayset.h"
#include "display7segment.h"

#include "hal_i2c.h"
#include "hardware.h"
Expand Down
10 changes: 4 additions & 6 deletions lib-display/src/i2c/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@

#include "hal_i2c.h"

using namespace display;

Display *Display::s_pThis = nullptr;
Display *Display::s_pThis;

Display::Display() : m_nMillis(Hardware::Get()->Millis()), m_I2C(display::segment7::I2C_ADDRESS) {
assert(s_pThis == nullptr);
Expand All @@ -60,7 +58,7 @@ Display::Display() : m_nMillis(Hardware::Get()->Millis()), m_I2C(display::segmen
Detect7Segment();

if (m_LcdDisplay != nullptr) {
timeout::gpio_init();
display::timeout::gpio_init();
}

PrintInfo();
Expand All @@ -75,7 +73,7 @@ Display::Display(uint32_t nRows) : m_nMillis(Hardware::Get()->Millis()), m_I2C(d
Detect7Segment();

if (m_LcdDisplay != nullptr) {
timeout::gpio_init();
display::timeout::gpio_init();
}

PrintInfo();
Expand All @@ -90,7 +88,7 @@ Display::Display(display::Type type): m_tType(type), m_nMillis(Hardware::Get()->
Detect7Segment();

if (m_LcdDisplay != nullptr) {
timeout::gpio_init();
display::timeout::gpio_init();
}

PrintInfo();
Expand Down
2 changes: 1 addition & 1 deletion lib-display/src/i2c/hd44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void Hd44780::PutChar(int c) {
void Hd44780::PutString(const char *pString) {
const char *p = pString;

for (uint32_t i = 0; *p != '\0'; i++) {
while (*p != '\0') {
Hd44780::PutChar(static_cast<int>(*p));
p++;
}
Expand Down
2 changes: 1 addition & 1 deletion lib-display/src/i2c/ssd1306.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void Ssd1306::PutChar(int c) {
void Ssd1306::PutString(const char *pString) {
const char *p = pString;

for (uint32_t i = 0; *p != '\0'; i++) {
while (*p != '\0') {
Ssd1306::PutChar(static_cast<int>(*p));
p++;
}
Expand Down

0 comments on commit d0b2e0c

Please sign in to comment.