1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-25 03:13:24 +01:00

Fixed incorrect display dimension ()

This commit is contained in:
Mikkel Jeppesen 2025-01-19 23:36:07 +01:00 committed by GitHub
parent 75026be951
commit 98b872abc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions
esphome/components/waveshare_epaper

View File

@ -72,7 +72,8 @@ void WaveshareEPaper2P13InV3::write_buffer_(uint8_t cmd, int top, int bottom) {
this->set_window_(top, bottom); this->set_window_(top, bottom);
this->command(cmd); this->command(cmd);
this->start_data_(); this->start_data_();
auto width_bytes = this->get_width_internal() / 8;
auto width_bytes = this->get_width_controller() / 8;
this->write_array(this->buffer_ + top * width_bytes, (bottom - top) * width_bytes); this->write_array(this->buffer_ + top * width_bytes, (bottom - top) * width_bytes);
this->end_data_(); this->end_data_();
} }
@ -162,7 +163,8 @@ void WaveshareEPaper2P13InV3::display() {
} }
} }
int WaveshareEPaper2P13InV3::get_width_internal() { return 128; } int WaveshareEPaper2P13InV3::get_width_controller() { return 128; }
int WaveshareEPaper2P13InV3::get_width_internal() { return 122; }
int WaveshareEPaper2P13InV3::get_height_internal() { return 250; } int WaveshareEPaper2P13InV3::get_height_internal() { return 250; }

View File

@ -811,6 +811,7 @@ class WaveshareEPaper2P13InV3 : public WaveshareEPaper {
void initialize() override; void initialize() override;
protected: protected:
int get_width_controller() override;
int get_width_internal() override; int get_width_internal() override;
int get_height_internal() override; int get_height_internal() override;
uint32_t idle_timeout_() override; uint32_t idle_timeout_() override;