From 0509eee6a5da04ce95bd8ff49c7b3c8f56ebaa27 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Thu, 2 Jul 2020 08:42:43 +0200 Subject: [PATCH] Update xsns_01_counter.ino --- tasmota/xsns_01_counter.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasmota/xsns_01_counter.ino b/tasmota/xsns_01_counter.ino index 0af9ee8a3..18f1ed461 100644 --- a/tasmota/xsns_01_counter.ino +++ b/tasmota/xsns_01_counter.ino @@ -98,7 +98,11 @@ void CounterUpdate(uint8_t index) // add 100.000 cpu ticks to ensure right step calculation uint32_t steps = (current_cycle-last_cycle+100000)/(clockCyclesPerMicrosecond() * 10000); cycle_time = (current_cycle-last_cycle)/steps; - analogWriteCCyPeriod(Pin(GPIO_PWM1, index), 5, cycle_time ); + #ifdef ESP8266 + analogWriteCCyPeriod(Pin(GPIO_PWM1, index), 5, cycle_time ); + #else + analogWrite(Pin(GPIO_PWM1, index), 5); + #endif } last_cycle = current_cycle; }