Shitf595 dynamic device count (#22543)

* Make max Shift595 device count dynamic

* Update xdrv_60_shift595.ino
This commit is contained in:
Jacek Ziółkowski 2024-11-25 10:38:43 +01:00 committed by GitHub
parent e397c11e70
commit 3ab87273e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ void Shift595SwitchRelay(void) {
} }
void CmndShift595Devices(void) { void CmndShift595Devices(void) {
if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload <= 3)) { if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload * 8 <= MAX_RELAYS_SET - Shift595->first)) {
Settings->shift595_device_count = (1 == XdrvMailbox.payload) ? SHIFT595_DEVICE_COUNT : XdrvMailbox.payload; Settings->shift595_device_count = (1 == XdrvMailbox.payload) ? SHIFT595_DEVICE_COUNT : XdrvMailbox.payload;
TasmotaGlobal.restart_flag = 2; TasmotaGlobal.restart_flag = 2;
} }