cleanup, refactor

This commit is contained in:
Drath
2025-11-02 14:44:33 +01:00
parent 1689bf1b35
commit fa0eeabf72
2 changed files with 36 additions and 41 deletions

View File

@@ -14,6 +14,11 @@ class LCDDisplay {
std::string _dev;
char writebuf[LCD_LINES * LCD_COLS + 8]; // 4x40 chars + 2x4 setcursor commands
static constexpr bool dualDisp = (LCD_LINES * LCD_COLS > 80); // is it dual display device or not, evauluated from the size at compile time
void open();
void write(const uint8_t* cmdbuf, uint8_t len);
void close();
void writeLines(std::array<std::string, 4> lines); // do not use
// we avoid using these, use buffer (even if these are faster for small writes, perhaps a rewrite is in order)
void writeStr(std::string str);
@@ -22,8 +27,6 @@ class LCDDisplay {
public:
LCDDisplay(std::string dev, uint32_t baud = 0010002); // from termios-baud.h, B115200
~LCDDisplay();
void open();
void close();
void clear();
void setContrast(uint8_t contrast);
@@ -35,11 +38,10 @@ class LCDDisplay {
void writeBuf(uint8_t row, uint8_t col, std::string str);
void clearBuf();
void flushBuf();
char bar(uint8_t char_id, double value);
// returns custom char no. c, small enough to define in header
constexpr char cc(uint8_t c) { return c % 8; }
char bar(uint8_t char_id, double value);
};
#endif