Skip to content

Commit 0c46ea5

Browse files
authored
Merge pull request #90 from e-radionicacom/dev
Dev
2 parents feeb213 + fb163c4 commit 0c46ea5

File tree

6 files changed

+62
-16
lines changed

6 files changed

+62
-16
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=InkplateLibrary
2-
version=4.0.0
2+
version=4.0.1
33
author=e-radionica.com <[email protected]>
44
maintainer=David Zovko <[email protected]>
55
sentence=Inkplate boards driver library

src/Inkplate.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,15 @@ void Inkplate::einkOff()
118118
*
119119
* @note its important to use this order when turning epaper on.
120120
* using wrong order can irreparably damage epaper
121+
*
122+
* @return 1 if succesfully turned on, 0 if failed
121123
*/
122-
void Inkplate::einkOn()
124+
int Inkplate::einkOn()
123125
{
124126
if (getPanelState() == 1)
125127
return;
126128
WAKEUP_SET;
127-
delay(1);
129+
delay(2);
128130
PWRUP_SET;
129131

130132
// Enable all rails
@@ -153,11 +155,13 @@ void Inkplate::einkOn()
153155
WAKEUP_CLEAR;
154156
VCOM_CLEAR;
155157
PWRUP_CLEAR;
156-
return;
158+
return 0;
157159
}
158160

159161
OE_SET;
160162
setPanelState(1);
163+
164+
return 1;
161165
}
162166

163167
/**

src/boards/Inkplate10.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ void Inkplate::display1b()
200200
uint32_t _pos;
201201
uint8_t data;
202202
uint8_t dram;
203-
einkOn();
203+
if (!einkOn())
204+
{
205+
return;
206+
}
204207
clean(0, 10);
205208
clean(1, 10);
206209
clean(0, 10);
@@ -248,7 +251,10 @@ void Inkplate::display1b()
248251
*/
249252
void IRAM_ATTR Inkplate::display3b()
250253
{
251-
einkOn();
254+
if (!einkOn())
255+
{
256+
return;
257+
}
252258
clean(0, 10);
253259
clean(1, 10);
254260
clean(0, 10);
@@ -332,7 +338,10 @@ void Inkplate::partialUpdate(bool _forced)
332338
}
333339
}
334340

335-
einkOn();
341+
if (!einkOn())
342+
{
343+
return;
344+
}
336345
for (int k = 0; k < 5; ++k)
337346
{
338347
vscan_start();

src/boards/Inkplate5.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,12 @@ void Inkplate::display1b()
203203
uint32_t _pos;
204204
uint8_t data;
205205
uint8_t dram;
206-
einkOn();
206+
207+
if (!einkOn())
208+
{
209+
return;
210+
}
211+
207212
clean(0, 17);
208213
clean(1, 17);
209214
clean(0, 17);
@@ -279,7 +284,10 @@ void Inkplate::display1b()
279284
*/
280285
void IRAM_ATTR Inkplate::display3b()
281286
{
282-
einkOn();
287+
if (!einkOn())
288+
{
289+
return;
290+
}
283291
clean(0, 17);
284292
clean(1, 17);
285293
clean(0, 17);
@@ -362,7 +370,11 @@ void Inkplate::partialUpdate(bool _forced)
362370
}
363371
}
364372

365-
einkOn();
373+
if (!einkOn())
374+
{
375+
return;
376+
}
377+
366378
for (int k = 0; k < 5; k++)
367379
{
368380
vscan_start();

src/boards/Inkplate6.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ void Inkplate::display1b()
184184
uint32_t _send;
185185
uint8_t data;
186186
uint8_t dram;
187-
einkOn();
187+
188+
if (!einkOn())
189+
{
190+
return;
191+
}
188192

189193
clean(0, 1);
190194
clean(1, 21);
@@ -294,7 +298,10 @@ void Inkplate::display1b()
294298
*/
295299
void Inkplate::display3b()
296300
{
297-
einkOn();
301+
if (!einkOn())
302+
{
303+
return;
304+
}
298305
clean(0, 1);
299306
clean(1, 21);
300307
clean(2, 1);
@@ -381,7 +388,11 @@ void Inkplate::partialUpdate(bool _forced)
381388
}
382389
}
383390

384-
einkOn();
391+
if (!einkOn())
392+
{
393+
return;
394+
}
395+
385396
for (int k = 0; k < 5; ++k)
386397
{
387398
vscan_start();

src/boards/Inkplate6plus.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ void Inkplate::display1b()
271271
uint32_t _pos;
272272
uint8_t data;
273273
uint8_t dram;
274-
einkOn();
274+
if (!einkOn())
275+
{
276+
return;
277+
}
275278

276279
clean(0, 1);
277280
clean(1, 15);
@@ -349,7 +352,10 @@ void Inkplate::display1b()
349352
*/
350353
void Inkplate::display3b()
351354
{
352-
einkOn();
355+
if (!einkOn())
356+
{
357+
return;
358+
}
353359
clean(0, 1);
354360
clean(1, 15);
355361
clean(2, 1);
@@ -434,7 +440,11 @@ void Inkplate::partialUpdate(bool _forced)
434440
}
435441
}
436442

437-
einkOn();
443+
if (!einkOn())
444+
{
445+
return;
446+
}
447+
438448
for (int k = 0; k < 5; k++)
439449
{
440450
vscan_start();

0 commit comments

Comments
 (0)