Skip to content

Commit a3c8256

Browse files
committed
Fixes for new board def
1 parent 1f8bf43 commit a3c8256

File tree

7 files changed

+56
-12
lines changed

7 files changed

+56
-12
lines changed

src/Inkplate.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,7 @@ Inkplate::Inkplate() : Adafruit_GFX(E_INK_WIDTH, E_INK_HEIGHT), Graphics(E_INK_W
2626
Inkplate::Inkplate(uint8_t _mode) : Adafruit_GFX(E_INK_WIDTH, E_INK_HEIGHT), Graphics(E_INK_WIDTH, E_INK_HEIGHT)
2727
#endif
2828
{
29-
#ifndef ARDUINO_INKPLATECOLOR
3029
setDisplayMode(_mode);
31-
for (uint32_t i = 0; i < 256; ++i)
32-
pinLUT[i] = ((i & B00000011) << 4) | (((i & B00001100) >> 2) << 18) | (((i & B00010000) >> 4) << 23) |
33-
(((i & B11100000) >> 5) << 25);
34-
#endif
35-
36-
#ifdef ARDUINO_ESP32_DEV
37-
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, HIGH);
38-
#else
39-
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, LOW);
40-
#endif
4130
}
4231

4332
/**

src/boards/Inkplate10.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ bool Inkplate::begin(uint8_t lightWaveform)
4242
return 0;
4343

4444
Wire.begin();
45+
46+
#ifndef ARDUINO_INKPLATECOLOR
47+
for (uint32_t i = 0; i < 256; ++i)
48+
pinLUT[i] = ((i & B00000011) << 4) | (((i & B00001100) >> 2) << 18) | (((i & B00010000) >> 4) << 23) |
49+
(((i & B11100000) >> 5) << 25);
50+
#endif
51+
52+
#ifdef ARDUINO_ESP32_DEV
53+
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, HIGH);
54+
#else
55+
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, LOW);
56+
#endif
57+
4558
memset(mcpRegsInt, 0, 22);
4659
memset(mcpRegsEx, 0, 22);
4760
mcpBegin(MCP23017_INT_ADDR, mcpRegsInt);

src/boards/Inkplate5.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ bool Inkplate::begin(void)
3636
return 0;
3737

3838
Wire.begin();
39+
40+
#ifndef ARDUINO_INKPLATECOLOR
41+
setDisplayMode(_mode);
42+
for (uint32_t i = 0; i < 256; ++i)
43+
pinLUT[i] = ((i & B00000011) << 4) | (((i & B00001100) >> 2) << 18) | (((i & B00010000) >> 4) << 23) |
44+
(((i & B11100000) >> 5) << 25);
45+
#endif
46+
47+
#ifdef ARDUINO_ESP32_DEV
48+
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, HIGH);
49+
#else
50+
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, LOW);
51+
#endif
52+
3953
memset(mcpRegsInt, 0, 22);
4054
memset(mcpRegsEx, 0, 22);
4155
mcpBegin(MCP23017_INT_ADDR, mcpRegsInt);

src/boards/Inkplate6.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ bool Inkplate::begin(void)
3939
return 0;
4040

4141
Wire.begin();
42+
43+
#ifndef ARDUINO_INKPLATECOLOR
44+
for (uint32_t i = 0; i < 256; ++i)
45+
pinLUT[i] = ((i & B00000011) << 4) | (((i & B00001100) >> 2) << 18) | (((i & B00010000) >> 4) << 23) |
46+
(((i & B11100000) >> 5) << 25);
47+
#endif
48+
49+
#ifdef ARDUINO_ESP32_DEV
50+
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, HIGH);
51+
#else
52+
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, LOW);
53+
#endif
54+
4255
memset(mcpRegsInt, 0, 22);
4356
mcpBegin(MCP23017_ADDR, mcpRegsInt);
4457
pinModeInternal(MCP23017_INT_ADDR, mcpRegsInt, VCOM, OUTPUT);

src/boards/Inkplate6plus.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,21 @@ bool Inkplate::begin(void)
8787
{
8888
if (_beginDone == 1)
8989
return 0;
90+
9091
Wire.begin();
92+
93+
#ifndef ARDUINO_INKPLATECOLOR
94+
for (uint32_t i = 0; i < 256; ++i)
95+
pinLUT[i] = ((i & B00000011) << 4) | (((i & B00001100) >> 2) << 18) | (((i & B00010000) >> 4) << 23) |
96+
(((i & B11100000) >> 5) << 25);
97+
#endif
98+
99+
#ifdef ARDUINO_ESP32_DEV
100+
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, HIGH);
101+
#else
102+
digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, 9, LOW);
103+
#endif
104+
91105
memset(mcpRegsInt, 0, 22);
92106
memset(mcpRegsEx, 0, 22);
93107
mcpBegin(MCP23017_INT_ADDR, mcpRegsInt);

src/boards/InkplateColor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ bool Inkplate::begin(void)
4040
// buffer and clear frame buffer
4141
if (!_beginDone)
4242
{
43+
Wire.begin();
44+
4345
_beginDone = true;
4446
SPI.begin();
4547
pinMode(EPAPER_BUSY_PIN, INPUT);

src/include/Image.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "Arduino.h"
2525
#include "ImageDitherColorKernels.h"
2626
#include "NetworkClient.h"
27-
#include "WiFiClient.h"
2827
#include "defines.h"
2928

3029
/**

0 commit comments

Comments
 (0)