From 657c08c653c00fa31957addf309811b8519431e4 Mon Sep 17 00:00:00 2001 From: peteGSX Date: Thu, 18 Jan 2024 18:56:15 +1000 Subject: [PATCH] Update EX-IOExpander copyright --- IO_EXIOExpander.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/IO_EXIOExpander.h b/IO_EXIOExpander.h index b5c40c9..191bf3c 100644 --- a/IO_EXIOExpander.h +++ b/IO_EXIOExpander.h @@ -1,5 +1,6 @@ /* * © 2022, Peter Cole. All rights reserved. + * © 2022, Harald Barth. All rights reserved. * * This file is part of EX-CommandStation * @@ -101,13 +102,13 @@ private: // Not enough space, free any existing buffer and allocate a new one if (_digitalPinBytes > 0) free(_digitalInputStates); if ((_digitalInputStates = (byte*) calloc(digitalBytesNeeded, 1)) != NULL) { - _digitalPinBytes = digitalBytesNeeded; - } else { - DIAG(F("EX-IOExpander I2C:%s ERROR alloc %d bytes"), _I2CAddress.toString(), digitalBytesNeeded); - _deviceState = DEVSTATE_FAILED; - _digitalPinBytes = 0; - return; - } + _digitalPinBytes = digitalBytesNeeded; + } else { + DIAG(F("EX-IOExpander I2C:%s ERROR alloc %d bytes"), _I2CAddress.toString(), digitalBytesNeeded); + _deviceState = DEVSTATE_FAILED; + _digitalPinBytes = 0; + return; + } } }