Fix undocumented support

Fix undocumented support for non-sequential buttons and switches (#17967)
This commit is contained in:
Theo Arends 2023-02-18 14:30:40 +01:00
parent 3be29dfecd
commit 89ccfe910e
4 changed files with 9 additions and 10 deletions

View File

@ -9,10 +9,13 @@ All notable changes to this project will be documented in this file.
### Breaking Changed
### Changed
- ADC Range oversample from 2 to 32 (#17975)
### Fixed
- SEN5X floats and units (#17961)
- Energytotals cannot be set to negative values (#17965)
- Undocumented support for non-sequential buttons and switches (#17967)
- SR04 driver single pin ultrasonic sensor detection (#17966)
### Removed

View File

@ -116,7 +116,9 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Breaking Changed
### Changed
- ADC Range oversample from 2 to 32 [#17975](https://github.com/arendst/Tasmota/issues/17975)
### Fixed
- SEN5X floats and units [#17961](https://github.com/arendst/Tasmota/issues/17961)
- Energytotals cannot be set to negative values [#17965](https://github.com/arendst/Tasmota/issues/17965)
- SR04 driver single pin ultrasonic sensor detection [#17966](https://github.com/arendst/Tasmota/issues/17966)

View File

@ -134,10 +134,7 @@ void ButtonProbe(void) {
uint32_t not_activated;
for (uint32_t i = 0; i < MAX_KEYS_SET; i++) {
if (!bitRead(Button.used, i)) {
Button.probe_mutex = false;
return;
}
if (!bitRead(Button.used, i)) { continue; }
if (PinUsed(GPIO_KEY1, i)) {
#if defined(SOC_TOUCH_VERSION_1) || defined(SOC_TOUCH_VERSION_2)
@ -334,7 +331,7 @@ void ButtonHandler(void) {
char scmnd[20];
for (uint32_t button_index = 0; button_index < MAX_KEYS_SET; button_index++) {
if (!bitRead(Button.used, button_index)) { return; }
if (!bitRead(Button.used, button_index)) { continue; }
uint8_t button = Button.debounced_state[button_index];

View File

@ -142,10 +142,7 @@ void SwitchProbe(void) {
uint32_t not_activated;
for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) {
if (!bitRead(Switch.used, i)) {
Switch.probe_mutex = false;
return;
}
if (!bitRead(Switch.used, i)) { continue; }
if (PinUsed(GPIO_SWT1, i)) {
not_activated = digitalRead(Pin(GPIO_SWT1, i));
@ -288,7 +285,7 @@ void SwitchHandler(void) {
uint32_t loops_per_second = 1000 / Settings->switch_debounce;
for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) {
if (!bitRead(Switch.used, i)) { return; }
if (!bitRead(Switch.used, i)) { continue; }
uint32_t button = Switch.debounced_state[i];
uint32_t switchflag = POWER_TOGGLE +1;