mirror of
https://github.com/wled/WLED.git
synced 2025-07-25 19:56:32 +00:00
bug fix
This commit is contained in:
parent
c942345453
commit
9bb979f2e8
@ -272,7 +272,7 @@ unsigned *PinManagerClass::getReadOnlyPins()
|
|||||||
#ifdef READ_ONLY_PINS
|
#ifdef READ_ONLY_PINS
|
||||||
static unsigned readOnlyPins[] = {READ_ONLY_PINS};
|
static unsigned readOnlyPins[] = {READ_ONLY_PINS};
|
||||||
#else
|
#else
|
||||||
static unsigned readOnlyPins[] = 255;
|
static unsigned readOnlyPins[] = {255};
|
||||||
#endif
|
#endif
|
||||||
return readOnlyPins;
|
return readOnlyPins;
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ unsigned *PinManagerClass::getReadOnlyPins()
|
|||||||
bool PinManagerClass::isReadOnlyPin(byte gpio)
|
bool PinManagerClass::isReadOnlyPin(byte gpio)
|
||||||
{
|
{
|
||||||
const unsigned* pins = PinManagerClass::getReadOnlyPins();
|
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++) {
|
for (unsigned i = 0; i < numPins; i++) {
|
||||||
if (pins[i] == gpio) {
|
if (pins[i] == gpio) {
|
||||||
|
@ -192,7 +192,7 @@ void appendGPIOinfo() {
|
|||||||
// add info for read-only GPIO
|
// add info for read-only GPIO
|
||||||
oappend(SET_F("d.ro_gpio=["));
|
oappend(SET_F("d.ro_gpio=["));
|
||||||
const unsigned* readOnlyPins = pinManager.getReadOnlyPins();
|
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++) {
|
for (unsigned i = 0; i < numReadOnlyPins; i++) {
|
||||||
// Ignore 255
|
// Ignore 255
|
||||||
if (readOnlyPins[i] <= WLED_NUM_PINS) {
|
if (readOnlyPins[i] <= WLED_NUM_PINS) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user