diff --git a/IODevice.cpp b/IODevice.cpp index 5fd27ff..3456af5 100644 --- a/IODevice.cpp +++ b/IODevice.cpp @@ -327,12 +327,14 @@ IONotifyCallback *IONotifyCallback::first = 0; ArduinoPins::ArduinoPins(VPIN firstVpin, int nPins) { _firstVpin = firstVpin; _nPins = nPins; - uint8_t arrayLen = (_nPins+7)/8; - _pinPullups = (uint8_t *)calloc(2, arrayLen); + int arrayLen = (_nPins+7)/8; + _pinPullups = (uint8_t *)calloc(3, arrayLen); _pinModes = (&_pinPullups[0]) + arrayLen; + _pinInUse = (&_pinPullups[0]) + 2*arrayLen; for (int i=0; i