@@ -363,6 +363,7 @@ void Inkplate::setIOExpanderForLowPower()
363
363
364
364
// Battery voltage Switch MOSFET
365
365
pinModeInternal (IO_INT_ADDR, ioRegsInt, IO_PIN_B1, OUTPUT);
366
+ digitalWriteInternal (IO_INT_ADDR, ioRegsInt, IO_PIN_B1, LOW);
366
367
367
368
// Rest of pins go to OUTPUT LOW state because in deepSleep mode they are
368
369
// using least amount of power
@@ -395,16 +396,48 @@ void Inkplate::setIOExpanderForLowPower()
395
396
396
397
void Inkplate::sleepColorPanel ()
397
398
{
398
- // First wake the panel
399
- setPanelDeepSleep (false );
399
+ Serial.println (" In sleep colorpanel!" );
400
+
401
+ delay (3000 );
402
+ Serial.println (" JUST BEFORE SET PANEL DEEP SLEEP FALSE!" );
403
+ Serial.flush ();
404
+
405
+ setPanelDeepSleep (false ); // First, wake the panel back up
406
+
407
+ delay (3000 );
408
+ Serial.println (" JUST BEFORE SENDING SLEEP STUFF!" );
409
+ Serial.flush ();
400
410
401
- // Now send the sleep command delay(10);
411
+ // put the panel to sleep via command
412
+ delay (10 );
402
413
sendCommand (DEEP_SLEEP_REGISTER);
403
414
sendData (0xA5 );
404
- delay (100 );
405
- digitalWrite (EPAPER_DC_PIN, LOW);
406
- digitalWrite (EPAPER_CS_PIN, LOW);
407
- digitalWrite (EPAPER_RST_PIN, HIGH); // Make sure this is HIGH so the display is on
408
- gpio_deep_sleep_hold_en (); // Make sure RST pin stays high during sleep
415
+ delay (100 ); // Wait a bit until it's surely in sleep
416
+
417
+ delay (3000 );
418
+ Serial.println (" JUST BEFORE SDCARD SLEEP!" );
419
+ Serial.flush ();
420
+
421
+
422
+ // Make sure the SD card is in sleep
423
+ sdCardSleep ();
424
+ delay (10 );
425
+
426
+ delay (3000 );
427
+ Serial.println (" JUST BEFORE WRITING HIGH RST PIN!" );
428
+ Serial.flush ();
429
+
430
+
431
+ digitalWrite (EPAPER_RST_PIN, HIGH);
432
+
433
+ delay (3000 );
434
+ Serial.println (" just before sleep hold en!" );
435
+ Serial.flush ();
436
+
437
+ gpio_deep_sleep_hold_en (); // Make sure RST pin stays high during sleep
438
+
439
+ delay (3000 );
440
+ Serial.println (" just after sleep hold en!" );
441
+ Serial.flush ();
409
442
}
410
443
#endif
0 commit comments