Add command ``SetOption46 0..255``

Add command ``SetOption46 0..255`` to add 0..255 * 10 milliseconds power on delay before initializing I/O (#15438)
This commit is contained in:
Theo Arends 2022-09-15 17:17:16 +02:00
parent 1f01ca0cc4
commit 971b06ccdd
4 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- Berry has persistent MQTT subscriptions: auto-subscribe at (re)connection
- Berry automated solidification of code
- Support of optional file calib.dat on ADE7953 based energy monitors like Shelly EM (#16486)
- Command ``SetOption46 0..255`` to add 0..255 * 10 milliseconds power on delay before initializing I/O (#15438)
### Changed
- ESP32 Increase number of button GPIOs from 8 to 28 (#16518)

View File

@ -109,6 +109,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
## Changelog v12.1.1.2
### Added
- Command ``SetOption46 0..255`` to add 0..255 * 10 milliseconds power on delay before initializing I/O [#15438](https://github.com/arendst/Tasmota/issues/15438)
- Command ``SetOption146 1`` to enable display of ESP32 internal temperature
- Command ``StatusRetain`` [#11109](https://github.com/arendst/Tasmota/issues/11109)
- Command ``DspSpeed 2..127`` to control message rotation speed on display of POWR3xxD and THR3xxD

View File

@ -358,7 +358,7 @@ enum SO32_49Index { P_HOLD_TIME, // SetOption32 - (Button/Switch) K
P_ROTARY_MAX_STEP, // SetOption43 - (Rotary) Rotary step boundary (default 10)
P_IR_TOLERANCE, // SetOption44 - (IR) Base tolerance percentage for matching incoming IR messages (default 25, max 100)
P_BISTABLE_PULSE, // SetOption45 - (Bistable) Pulse time for two coil bistable latching relays (default 40)
P_SO46_FREE, // SetOption46
P_POWER_ON_DELAY, // SetOption46 - (PowerOn) Add delay of 10 x value milliseconds at power on
P_SO47_FREE, // SetOption47
P_SO48_FREE, // SetOption48
P_SO49_FREE // SetOption49

View File

@ -416,6 +416,8 @@ void SetPowerOnState(void)
}
}
// AddLog(LOG_LEVEL_DEBUG, PSTR("PWR: PowerOnState %d restored"), Settings->poweronstate);
// Issue #526 and #909
uint32_t port = 0;
for (uint32_t i = 0; i < TasmotaGlobal.devices_present; i++) {
@ -2160,6 +2162,8 @@ void GpioInit(void)
}
}
delay(Settings->param[P_POWER_ON_DELAY] * 10); // SetOption46 - Allow Wemos D1 power to stabilize before starting I2C polling for devices powered locally
#ifdef USE_I2C
TasmotaGlobal.i2c_enabled = (PinUsed(GPIO_I2C_SCL) && PinUsed(GPIO_I2C_SDA));
if (TasmotaGlobal.i2c_enabled) {