try to move away from hardcoded values, see if i can make it support different displays
This commit is contained in:
@@ -106,12 +106,12 @@ void LCDDisplay::clearBuf() {
|
||||
/* hyper optimized buffer flush command, writes whole disp with a single write */
|
||||
void LCDDisplay::flushBuf() {
|
||||
// we could skip all of this and set it in constructor if we were extra sure the lines wont ever exceed 40 chars
|
||||
uint8_t setDisp[] = {254, 71, 1, 1}; // set cursor to char 1, line 1
|
||||
constexpr uint8_t setDisp[] = {254, 71, 1, 1}; // set cursor to char 1, line 1
|
||||
std::memcpy(&writebuf[0], setDisp, 4);
|
||||
std::memcpy(&writebuf[84], setDisp, 4);
|
||||
writebuf[87] = 3; // overwrite set cursor c1 l1 to c1 l3
|
||||
|
||||
write(_lcd, writebuf, 168);
|
||||
write(_lcd, writebuf, sizeof(writebuf));
|
||||
}
|
||||
|
||||
char LCDDisplay::bar(uint8_t char_id, double value) {
|
||||
|
||||
Reference in New Issue
Block a user