Skip to content

Commit

Permalink
Update GxEPD2_EPD.cpp
Browse files Browse the repository at this point in the history
fix for RP2040
  • Loading branch information
ZinggJM committed Oct 5, 2023
1 parent 283ed63 commit 260ffc6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/GxEPD2_EPD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ void GxEPD2_EPD::init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset
}
if (_cs >= 0)
{
digitalWrite(_cs, HIGH);
digitalWrite(_cs, HIGH); // preset (less glitch for any analyzer)
pinMode(_cs, OUTPUT);
digitalWrite(_cs, HIGH); // set (needed e.g. for RP2040)
}
if (_dc >= 0)
{
digitalWrite(_dc, HIGH);
digitalWrite(_dc, HIGH); // preset (less glitch for any analyzer)
pinMode(_dc, OUTPUT);
digitalWrite(_dc, HIGH); // set (needed e.g. for RP2040)
}
_reset();
if (_busy >= 0)
Expand Down Expand Up @@ -110,14 +112,16 @@ void GxEPD2_EPD::_reset()
{
digitalWrite(_rst, LOW);
pinMode(_rst, OUTPUT);
digitalWrite(_rst, LOW);
delay(_reset_duration);
pinMode(_rst, INPUT_PULLUP);
delay(_reset_duration > 10 ? _reset_duration : 10);
}
else
{
digitalWrite(_rst, HIGH); // NEEDED for Waveshare "clever" reset circuit, power controller before reset pulse
digitalWrite(_rst, HIGH); // NEEDED for Waveshare "clever" reset circuit, power controller before reset pulse, preset (less glitch for any analyzer)
pinMode(_rst, OUTPUT);
digitalWrite(_rst, HIGH); // NEEDED for Waveshare "clever" reset circuit, power controller before reset pulse, set (needed e.g. for RP2040)
delay(10); // NEEDED for Waveshare "clever" reset circuit, at least delay(2);
digitalWrite(_rst, LOW);
delay(_reset_duration);
Expand Down

0 comments on commit 260ffc6

Please sign in to comment.