tm1637 - support 6 character displays (#1803)

This commit is contained in:
Anthony Uk 2021-05-22 01:04:25 +02:00 committed by GitHub
parent 96e46db272
commit 514d11d46f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -253,7 +253,7 @@ uint8_t TM1637Display::print(uint8_t start_pos, const char* str) {
pos--;
this->buffer_[pos] |= 0b10000000;
} else {
if (pos >= 4) {
if (pos >= 6) {
ESP_LOGE(TAG, "String is too long for the display!");
break;
}

View file

@ -63,7 +63,7 @@ class TM1637Display : public PollingComponent {
GPIOPin *clk_pin_;
uint8_t intensity_;
optional<tm1637_writer_t> writer_{};
uint8_t buffer_[4] = {0};
uint8_t buffer_[6] = {0};
};
} // namespace tm1637