Skip to content

Commit

Permalink
Move Wireless Paper V1.1 custom hibernate behavior to GxEPD2
Browse files Browse the repository at this point in the history
Previously implemented with a macro, in meshtastic/firmware.
  • Loading branch information
todd-herbert committed Mar 5, 2024
1 parent 378318c commit f27cf38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
13 changes: 1 addition & 12 deletions src/epd/GxEPD2_213_FC1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,10 @@ void GxEPD2_213_FC1::powerOff()
_PowerOff();
}

// Put the display into an extra-low power state. Hard reset required to wake.
// Caution: will wipe display memory - problematic for fast-refresh, so not used by meshtastic
// No hibernate for this display, only power off. Preserves image memory for fast refresh.
void GxEPD2_213_FC1::hibernate()
{
_PowerOff();
if (_rst >= 0)
{
_writeCommand(0x07); // deep sleep mode
_writeData(0xA5); // enter deep sleep
_hibernating = true;
_configured_for_full = false;
_configured_for_fast = false;
}
}

void GxEPD2_213_FC1::_PowerOn()
Expand Down Expand Up @@ -280,7 +271,6 @@ void GxEPD2_213_FC1::_Update_Full()
_PowerOn();
_writeCommand(0x12);
_waitWhileBusy("_Update_Full", full_refresh_time);
_PowerOff();
}

void GxEPD2_213_FC1::_Update_Part()
Expand All @@ -289,7 +279,6 @@ void GxEPD2_213_FC1::_Update_Part()
_PowerOn();
_writeCommand(0x12);
_waitWhileBusy("_Update_Part", partial_refresh_time);
_PowerOff();
}

// Fast refresh waveform is unofficial (experimental?)
Expand Down
2 changes: 1 addition & 1 deletion src/epd/GxEPD2_213_FC1.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class GxEPD2_213_FC1 : public GxEPD2_EPD
void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen
void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, fast-refresh
void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time
void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
void hibernate(); // For this display, no deep sleep, only power off. Preserves image memory for fast refresh

// Unimplemented for meshtastic
public:
Expand Down

0 comments on commit f27cf38

Please sign in to comment.