1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 06:38:17 +00:00

fix: (Component WaveshareEpaper) Correct display tx cmd

This commit is contained in:
rrachasak 2024-12-20 14:52:43 +07:00
parent ec5fccf9c8
commit 9e05af358d
No known key found for this signature in database

View File

@ -1960,19 +1960,22 @@ void WaveshareEPaper4P2InBV2::initialize() {
}
void HOT WaveshareEPaper4P2InBV2::display() {
const size_t buf_len = this->get_buffer_length_() / 2u;
const uint32_t buf_half_len = this->get_buffer_length_() / 2u;
// COMMAND DATA START TRANSMISSION 1 (B/W data)
this->command(0x10);
this->start_data_();
this->write_array(this->buffer_, buf_len);
for (size_t i = 0; i < buf_half_len; i++) {
this->data(this->buffer_[i]);
}
this->end_data_();
delay(2);
// COMMAND DATA START TRANSMISSION 2 (RED data)
this->command(0x13);
this->start_data_();
this->write_array(this->buffer_ + buf_len, buf_len);
for (size_t i = 0; i < buf_half_len; i++) {
this->data(this->buffer_[i + buf_half_len]);
}
this->end_data_();
delay(2);