File tree Expand file tree Collapse file tree 6 files changed +62
-16
lines changed
Expand file tree Collapse file tree 6 files changed +62
-16
lines changed Original file line number Diff line number Diff line change 11name =InkplateLibrary
2- version =4.0.0
2+ version =4.0.1
33author =e-radionica.com <
[email protected] >
44maintainer =David Zovko <
[email protected] >
55sentence =Inkplate boards driver library
Original file line number Diff line number Diff 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/* *
Original file line number Diff line number Diff 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 */
249252void 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 ();
Original file line number Diff line number Diff 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 */
280285void 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 ();
Original file line number Diff line number Diff 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 */
295299void 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 ();
Original file line number Diff line number Diff 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 */
350353void 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 ();
You can’t perform that action at this time.
0 commit comments