mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 07:02:21 +01:00
Early pin init (#3439)
* Added early_pin_init configuration parameter for ESP8266 platform * Added #include to core * Updated test3.yaml to include early_pin_init parameter Co-authored-by: Rainer Oellermann <ro@playplaycode.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifdef USE_ESP8266
|
||||
|
||||
#include "core.h"
|
||||
#include "esphome/core/defines.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "preferences.h"
|
||||
@@ -55,6 +56,7 @@ extern "C" void resetPins() { // NOLINT
|
||||
// ourselves and this causes pins to toggle during reboot.
|
||||
force_link_symbols();
|
||||
|
||||
#ifdef USE_ESP8266_EARLY_PIN_INIT
|
||||
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];
|
||||
@@ -63,6 +65,7 @@ extern "C" void resetPins() { // NOLINT
|
||||
if (level != 255)
|
||||
digitalWrite(i, level); // NOLINT
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace esphome
|
||||
|
Reference in New Issue
Block a user