more consistent messags
This commit is contained in:
@@ -42,13 +42,13 @@ void LCDDisplay::clear() {
|
||||
}
|
||||
|
||||
void LCDDisplay::setContrast(uint8_t contrast) {
|
||||
std::println("[LCDDisplay] Set contrast to {}", contrast);
|
||||
std::println("[LCDDisplay::setContrast] Set contrast to {}", contrast);
|
||||
uint8_t cmdbuf[] = {254, 80, contrast};
|
||||
write(_lcd, &cmdbuf, 3);
|
||||
}
|
||||
|
||||
void LCDDisplay::setBacklight(bool enabled) {
|
||||
std::println("[LCDDisplay] Set backlight to {}", enabled);
|
||||
std::println("[LCDDisplay::setBacklight] Set backlight to {}", enabled);
|
||||
uint8_t cmdbuf[] = {254, (uint8_t)(enabled ? 66 : 70), 255};
|
||||
write(_lcd, &cmdbuf, enabled ? 3 : 2);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ void LCDDisplay::writeStr(std::string str) {
|
||||
void LCDDisplay::writeLines(std::array<std::string, 4> lines) {
|
||||
for (auto& line : lines) {
|
||||
if (line.size() > 40) {
|
||||
std::println("Line {} too long! ({} chars)", line, line.size());
|
||||
std::println("[LCDDisplay::writeLines] Line {} too long! ({} chars)", line, line.size());
|
||||
continue;
|
||||
}
|
||||
line.insert(line.end(), 40 - line.size(), ' ');
|
||||
@@ -106,7 +106,7 @@ void LCDDisplay::flushBuf() {
|
||||
void LCDDisplay::writeSStream(std::stringstream& ss) {
|
||||
std::string s = ss.str();
|
||||
if (s.size() != 160)
|
||||
std::println("[LCDDisplay] stringstream wrong ({} chars too short)", 160 - s.size()); // err
|
||||
std::println("[LCDDisplay::writeSStream] stringstream wrong ({} chars too short)", 160 - s.size()); // err
|
||||
setCursor(0, 0);
|
||||
writeStr(s.substr(0, 80));
|
||||
setCursor(2, 0);
|
||||
|
||||
Reference in New Issue
Block a user