This commit is contained in:
PaoloTK 2024-09-01 21:46:30 +02:00
parent c942345453
commit 9bb979f2e8
2 changed files with 3 additions and 3 deletions

View File

@ -272,7 +272,7 @@ unsigned *PinManagerClass::getReadOnlyPins()
#ifdef READ_ONLY_PINS
static unsigned readOnlyPins[] = {READ_ONLY_PINS};
#else
static unsigned readOnlyPins[] = 255;
static unsigned readOnlyPins[] = {255};
#endif
return readOnlyPins;
}
@ -280,7 +280,7 @@ unsigned *PinManagerClass::getReadOnlyPins()
bool PinManagerClass::isReadOnlyPin(byte gpio)
{
const unsigned* pins = PinManagerClass::getReadOnlyPins();
const unsigned numPins = sizeof(pins) / sizeof(pins[0]);
const unsigned numPins = (sizeof *pins) / (sizeof pins[0]);
for (unsigned i = 0; i < numPins; i++) {
if (pins[i] == gpio) {

View File

@ -192,7 +192,7 @@ void appendGPIOinfo() {
// add info for read-only GPIO
oappend(SET_F("d.ro_gpio=["));
const unsigned* readOnlyPins = pinManager.getReadOnlyPins();
const unsigned numReadOnlyPins = ((sizeof readOnlyPins) / (sizeof readOnlyPins[0]));
const unsigned numReadOnlyPins = (sizeof *readOnlyPins) / (sizeof readOnlyPins[0]);
for (unsigned i = 0; i < numReadOnlyPins; i++) {
// Ignore 255
if (readOnlyPins[i] <= WLED_NUM_PINS) {