Remove delay after hard reset

* Implemented by overloading the
  virtual method _reset() in GxEPD2_EPD
* Tested to write straight away
  and works ok. Seems unnecessary.
* 10ms might look like little but the
  ESP is not sleeping and CPUs are on.
  This is probably using 0.1 uAh
  (10% of display update total cost)
pull/242/head
Daniel Ansorregui 2024-01-16 23:12:59 +00:00
parent f369b6f207
commit be185cbd54
2 changed files with 19 additions and 0 deletions

View File

@ -441,6 +441,23 @@ void WatchyDisplay::_InitDisplay()
_setPartialRamArea(0, 0, WIDTH, HEIGHT);
}
void WatchyDisplay::_reset()
{
// Call default method if not configured the same way
if (_rst < 0 || !_pulldown_rst_mode) {
GxEPD2_EPD::_reset();
return;
}
digitalWrite(_rst, LOW);
pinMode(_rst, OUTPUT);
delay(_reset_duration);
pinMode(_rst, INPUT_PULLUP);
// Tested calling _powerOn() inmediately, and works ok, no need to sleep
// delay(_reset_duration > 10 ? _reset_duration : 0);
_hibernating = false;
}
void WatchyDisplay::_Init_Full()
{
_InitDisplay();

View File

@ -91,5 +91,7 @@ class WatchyDisplay : public GxEPD2_EPD
void _Update_Full();
void _Update_Part();
void _reset();
void _transferCommand(uint8_t command);
};