lil code formatting
This commit is contained in:
@@ -9,20 +9,6 @@
|
||||
#include <string>
|
||||
|
||||
class LCDDisplay {
|
||||
private:
|
||||
int _lcd = -1;
|
||||
std::string _dev;
|
||||
std::array<char, LCD_LINES * LCD_COLS + 8> writebuf{}; // 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(bool reopen = false);
|
||||
void write(const uint8_t* cmdbuf, uint8_t len);
|
||||
void close();
|
||||
|
||||
// we avoid using these, use buffer (even if these are faster for small writes, perhaps a rewrite is in order)
|
||||
void writeStr(const std::string& str);
|
||||
void writeStr(uint8_t row, uint8_t col, const std::string& str);
|
||||
|
||||
public:
|
||||
explicit LCDDisplay(const std::string& dev, uint32_t baud = 0010002); // from termios-baud.h, B115200
|
||||
~LCDDisplay();
|
||||
@@ -41,6 +27,20 @@ class LCDDisplay {
|
||||
|
||||
// returns custom char no. c, small enough to define in header
|
||||
static constexpr char cc(const uint8_t c) { return static_cast<char>(c % 8); }
|
||||
|
||||
private:
|
||||
int lcd = -1;
|
||||
std::string dev;
|
||||
std::array<char, LCD_LINES * LCD_COLS + 8> writebuf{}; // 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(bool reopen = false);
|
||||
void write(const uint8_t* cmdbuf, uint8_t len);
|
||||
void close();
|
||||
|
||||
// we avoid using these, use buffer (even if these are faster for small writes, perhaps a rewrite is in order)
|
||||
void writeStr(const std::string& str);
|
||||
void writeStr(uint8_t row, uint8_t col, const std::string& str);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -795,6 +795,6 @@ struct gpu_metrics_v3_0 {
|
||||
/* Metrics table alpha filter time constant [us] */
|
||||
uint32_t time_filter_alphavalue;
|
||||
};
|
||||
} // namespace gpu
|
||||
} // namespace metrics
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <string>
|
||||
|
||||
class HomeAssistant {
|
||||
public:
|
||||
public:
|
||||
struct Config {
|
||||
std::string address;
|
||||
std::string entity;
|
||||
|
||||
Reference in New Issue
Block a user