19
19
20
20
#include " Inkplate.h"
21
21
22
- #if defined(ARDUINO_INKPLATECOLOR) || defined(ARDUINO_INKPLATE2)
22
+ #if defined(ARDUINO_INKPLATECOLOR) || defined(ARDUINO_INKPLATE2) || defined(ARDUINO_INKPLATE4)
23
23
Inkplate::Inkplate () : Adafruit_GFX(E_INK_WIDTH, E_INK_HEIGHT), Graphics(E_INK_WIDTH, E_INK_HEIGHT)
24
24
#else
25
25
26
26
Inkplate::Inkplate (uint8_t _mode) : Adafruit_GFX(E_INK_WIDTH, E_INK_HEIGHT), Graphics(E_INK_WIDTH, E_INK_HEIGHT)
27
27
#endif
28
28
{
29
- #if !defined(ARDUINO_INKPLATECOLOR) && !defined(ARDUINO_INKPLATE2)
29
+ #if !defined(ARDUINO_INKPLATECOLOR) && !defined(ARDUINO_INKPLATE2) && !defined(ARDUINO_INKPLATE4)
30
30
setDisplayMode (_mode);
31
31
#endif
32
32
}
33
33
34
34
/* *
35
35
* @brief clearDisplay function clears memory buffer for display
36
36
*
37
- * @note This does not clears display, only buffer, you need to call
38
- * display() function after this to clear display
37
+ * @note This does not clear the actual display, only the memory buffer, you need to call
38
+ * display() function after this to clear the display
39
39
*/
40
40
void Inkplate::clearDisplay ()
41
41
{
42
42
#if defined(ARDUINO_INKPLATECOLOR)
43
43
memset (DMemory4Bit, WHITE << 4 | WHITE, E_INK_WIDTH * E_INK_HEIGHT / 2 );
44
44
#elif defined(ARDUINO_INKPLATE2)
45
- memset (DMemory4Bit, 255 , E_INK_WIDTH * E_INK_HEIGHT / 4 );
45
+ memset (DMemory4Bit, 0xFF , E_INK_WIDTH * E_INK_HEIGHT / 4 );
46
+ #elif defined(ARDUINO_INKPLATE4)
47
+ memset (DMemory4Bit, 0xFF , (E_INK_WIDTH * E_INK_HEIGHT / 8 ));
48
+ memset (DMemory4Bit + (E_INK_WIDTH * E_INK_HEIGHT / 8 ), 0x00 , (E_INK_WIDTH * E_INK_HEIGHT / 8 ));
46
49
#else
47
50
// Clear 1 bit per pixel display buffer
48
51
if (getDisplayMode () == 0 )
@@ -54,7 +57,7 @@ void Inkplate::clearDisplay()
54
57
#endif
55
58
}
56
59
57
- #if !defined(ARDUINO_INKPLATECOLOR) && !defined(ARDUINO_INKPLATE2)
60
+ #if !defined(ARDUINO_INKPLATECOLOR) && !defined(ARDUINO_INKPLATE2) && !defined(ARDUINO_INKPLATE4)
58
61
59
62
/* *
60
63
* @brief display function update display with new data from buffer
0 commit comments