@@ -71,22 +71,14 @@ bool Inkplate::begin(void)
71
71
delay (1 );
72
72
WAKEUP_CLEAR;
73
73
74
- // Set all pins of seconds I/O expander to outputs, low.
75
- // For some reason, it draw more current in deep sleep when pins are set as
76
- // inputs...
77
-
78
- for (int i = 0 ; i < 15 ; i++)
79
- {
80
- pinModeInternal (IO_EXT_ADDR, ioRegsEx, i, OUTPUT);
81
- digitalWriteInternal (IO_EXT_ADDR, ioRegsEx, i, LOW);
82
- }
83
-
84
- // For same reason, unused pins of first I/O expander have to be also set as
85
- // outputs, low.
86
- pinModeInternal (IO_INT_ADDR, ioRegsInt, 14 , OUTPUT);
87
- pinModeInternal (IO_INT_ADDR, ioRegsInt, 15 , OUTPUT);
88
- digitalWriteInternal (IO_INT_ADDR, ioRegsInt, 14 , LOW);
89
- digitalWriteInternal (IO_INT_ADDR, ioRegsInt, 15 , LOW);
74
+ // To reduce power consumption in deep sleep, unused pins of
75
+ // first I/O expander have to be also set as inputs with pull down
76
+ // resistors.
77
+ pinModeInternal (IO_INT_ADDR, ioRegsInt, 11 , INPUT_PULLDOWN);
78
+ pinModeInternal (IO_INT_ADDR, ioRegsInt, 12 , INPUT_PULLDOWN);
79
+ pinModeInternal (IO_INT_ADDR, ioRegsInt, 13 , INPUT_PULLDOWN);
80
+ pinModeInternal (IO_INT_ADDR, ioRegsInt, 14 , INPUT_PULLDOWN);
81
+ pinModeInternal (IO_INT_ADDR, ioRegsInt, 15 , INPUT_PULLDOWN);
90
82
91
83
// Set SPI pins to input to reduce power consumption in deep sleep
92
84
pinMode (12 , INPUT);
0 commit comments