mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 07:02:21 +01:00
ESP8266 early init for pins (#3144)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#ifdef USE_ESP8266
|
||||
|
||||
#include "core.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "preferences.h"
|
||||
@@ -53,6 +54,15 @@ extern "C" void resetPins() { // NOLINT
|
||||
// however, not strictly needed as we set up the pins properly
|
||||
// ourselves and this causes pins to toggle during reboot.
|
||||
force_link_symbols();
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
uint8_t mode = ESPHOME_ESP8266_GPIO_INITIAL_MODE[i];
|
||||
uint8_t level = ESPHOME_ESP8266_GPIO_INITIAL_LEVEL[i];
|
||||
if (mode != 255)
|
||||
pinMode(i, mode); // NOLINT
|
||||
if (level != 255)
|
||||
digitalWrite(i, level); // NOLINT
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace esphome
|
||||
|
Reference in New Issue
Block a user