|
@@ -92,15 +92,27 @@ class GxEPD2Display : public display::DisplayBuffer {
|
|
|
}
|
|
}
|
|
|
this->spi_.spi_setup();
|
|
this->spi_.spi_setup();
|
|
|
this->driver_->epd2.selectSPI(this->spi_, SPISettings());
|
|
this->driver_->epd2.selectSPI(this->spi_, SPISettings());
|
|
|
|
|
+ // GxEPD2's init() does a real panel clear/refresh, blocking on busy just
|
|
|
|
|
+ // like update() does below - it runs during ESPHome's synchronous
|
|
|
|
|
+ // setup() phase, before any component's dump_config() is called, which
|
|
|
|
|
+ // is why the whole boot log can appear to stall here.
|
|
|
|
|
+ uint32_t init_start = millis();
|
|
|
this->driver_->init(0);
|
|
this->driver_->init(0);
|
|
|
|
|
+ ESP_LOGD(TAG, "GxEPD2 init took %u ms", (unsigned) (millis() - init_start));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void update() override {
|
|
void update() override {
|
|
|
|
|
+ // GxEPD2 blocks synchronously on the panel's busy pin for the whole
|
|
|
|
|
+ // call below - this isn't peeking at gxepd2 internals, just timing the
|
|
|
|
|
+ // one call from the esphome side, to make that stall visible in the log
|
|
|
|
|
+ // instead of it looking like the main loop silently hung.
|
|
|
|
|
+ uint32_t start = millis();
|
|
|
this->driver_->setFullWindow();
|
|
this->driver_->setFullWindow();
|
|
|
this->driver_->firstPage();
|
|
this->driver_->firstPage();
|
|
|
do {
|
|
do {
|
|
|
this->do_update_();
|
|
this->do_update_();
|
|
|
} while (this->driver_->nextPage());
|
|
} while (this->driver_->nextPage());
|
|
|
|
|
+ ESP_LOGD(TAG, "Display update took %u ms", (unsigned) (millis() - start));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void dump_config() override {
|
|
void dump_config() override {
|