1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-16 23:47:10 +02:00

[st7567_i2c] Fix clang-tidy sign comparison warning (#11067)

This commit is contained in:
J. Nick Koston 2025-10-06 11:27:34 -05:00 committed by GitHub
parent b532e04ae4
commit 3f4250fcd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,8 +50,10 @@ void HOT I2CST7567::write_display_data() {
static const size_t BLOCK_SIZE = 64;
for (uint8_t x = 0; x < (uint8_t) this->get_width_internal(); x += BLOCK_SIZE) {
size_t remaining = static_cast<size_t>(this->get_width_internal()) - x;
size_t chunk = remaining > BLOCK_SIZE ? BLOCK_SIZE : remaining;
this->write_register(esphome::st7567_base::ST7567_SET_START_LINE, &buffer_[y * this->get_width_internal() + x],
this->get_width_internal() - x > BLOCK_SIZE ? BLOCK_SIZE : this->get_width_internal() - x);
chunk);
}
}
}