mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-14 18:46:59 +00:00
Merge pull request #3063 from sakinit/Fix-ESP32-undefined-pin-initialisation
Fix ESP32 undefined pin initialisation
This commit is contained in:
+4
-2
@@ -7,13 +7,15 @@
|
||||
void hardwareInit()
|
||||
{
|
||||
// set GPIO pins state if not set to default
|
||||
constexpr byte maxStates = sizeof(Settings.PinBootStates)/sizeof(Settings.PinBootStates[0]);
|
||||
for (byte gpio = 0; gpio < PIN_D_MAX; ++gpio) {
|
||||
bool serialPinConflict = (Settings.UseSerial && (gpio == 1 || gpio == 3));
|
||||
const int8_t bootState = (gpio < maxStates) ? Settings.PinBootStates[gpio] : 0;
|
||||
|
||||
if (!serialPinConflict && (Settings.PinBootStates[gpio] != 0)) {
|
||||
if (!serialPinConflict && (bootState != 0)) {
|
||||
const uint32_t key = createKey(1, gpio);
|
||||
|
||||
switch (Settings.PinBootStates[gpio])
|
||||
switch (bootState)
|
||||
{
|
||||
case 1:
|
||||
pinMode(gpio, OUTPUT);
|
||||
|
||||
Reference in New Issue
Block a user