Skip to content

Commit 33af033

Browse files
committed
Made "Waveshare Rev2.1" the default display driver.
1 parent 599c41f commit 33af033

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

case/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/gcode
1+
*.gcode

seedtool/hardware.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,25 @@
66
#include <GxEPD2_BW.h>
77
#include <Keypad.h>
88

9+
// Around April 2020 Waveshare started shipping a new version of the
10+
// "Waveshare 200x200, 1.54inch E-Ink display module". The new
11+
// versions have "Rev2.1" printed under the title on the circuit side
12+
// of the display. This new version requires a different driver
13+
// module from GxEPD2.
14+
//
15+
// If you have an *older* display (doesn't have "Rev2.1") uncomment
16+
// the following line:
17+
//
18+
// #define LEGACY_WAVESHARE
19+
20+
#if !defined(LEGACY_WAVESHARE)
21+
#define EPD_DRIVER GxEPD2_154_D67
22+
#else
23+
#define EPD_DRIVER GxEPD2_154
24+
#endif
25+
926
// This is hard to hide/encapsulate.
10-
extern GxEPD2_BW<GxEPD2_154, GxEPD2_154::HEIGHT> g_display;
27+
extern GxEPD2_BW<EPD_DRIVER, EPD_DRIVER::HEIGHT> g_display;
1128

1229
void hw_setup();
1330
void hw_green_led(int value);

seedtool/hardware.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ extern "C" {
6666

6767
// Display
6868
#if defined(ESP32)
69-
GxEPD2_BW<GxEPD2_154, GxEPD2_154::HEIGHT>
70-
g_display(GxEPD2_154(/*CS=*/ 21,
71-
/*DC=*/ 17,
72-
/*RST=*/ 16,
73-
/*BUSY=*/ 4));
69+
GxEPD2_BW<EPD_DRIVER, EPD_DRIVER::HEIGHT>
70+
g_display(EPD_DRIVER(/*CS=*/ 21,
71+
/*DC=*/ 17,
72+
/*RST=*/ 16,
73+
/*BUSY=*/ 4));
7474
#elif defined(SAMD51)
75-
GxEPD2_BW<GxEPD2_154, GxEPD2_154::HEIGHT>
76-
g_display(GxEPD2_154(/*CS=*/ PIN_A4,
77-
/*DC=*/ PIN_A3,
78-
/*RST=*/ PIN_A2,
79-
/*BUSY=*/ PIN_A1));
75+
GxEPD2_BW<EPD_DRIVER, EPD_DRIVER::HEIGHT>
76+
g_display(EPD_DRIVER(/*CS=*/ PIN_A4,
77+
/*DC=*/ PIN_A3,
78+
/*RST=*/ PIN_A2,
79+
/*BUSY=*/ PIN_A1));
8080
#endif
8181

8282
// Keypad

0 commit comments

Comments
 (0)