From 3fef91d6ca7b666882bd81c69734755d099eec29 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 27 Apr 2020 17:28:05 +0200 Subject: [PATCH] Change pin handling part 6 --- tasmota/support.ino | 6 ++++++ tasmota/support_tasmota.ino | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index 10e34ada7..0986a007e 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -1109,6 +1109,12 @@ void SetPin(uint32_t lpin, uint32_t gpio) { */ } +void InitAllPins(void) { + for (uint32_t i = 0; i < ARRAY_SIZE(pin); i++) { + SetPin(99, i); + } +} + void DigitalWrite(uint32_t gpio_pin, uint32_t index, uint32_t state) { if (PinUsed(gpio_pin, index)) { diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index a6a293ae3..3db5ea2f7 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -1383,9 +1383,7 @@ void GpioInit(void) my_adc0 = template_adc0; // Force Template override } - for (uint32_t i = 0; i < GPIO_MAX; i++) { - SetPin(99, i); - } + InitAllPins(); for (uint32_t i = 0; i < ARRAY_SIZE(my_module.io); i++) { uint32_t mpin = ValidPin(i, my_module.io[i]);