From 816cbcafe1cc6328efd979f55a93700bd14a262d Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Mon, 11 Jan 2021 17:45:06 +0100 Subject: [PATCH] fix pwm ESP32 --- tasmota/xdrv_10_scripter.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index f850bb048..5f5c57405 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -4245,10 +4245,14 @@ int16_t Run_script_sub(const char *type, int8_t tlen, JsonParserObject *jo) { lp += 3; uint8_t channel = 1; if (*(lp+1)=='(') { - channel = *lp & 7; - if (channel > 5) { - channel = 5; - } + channel = *lp & 0x0f; +#ifdef ESP8266 + if (channel > 5) {channel = 5;} +#endif // ESP8266 +#ifdef ESP32 + if (channel > 8) {channel = 8;} +#endif // ESP32 + if (channel < 1) {channel = 1;} lp += 2; } else { if (*lp=='(') {