Update xsns_01_counter.ino

This commit is contained in:
stefanbode 2020-07-07 16:26:44 +02:00 committed by GitHub
parent 7c2d9673a1
commit ce7070b0a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,9 +81,8 @@ void CounterUpdate(uint8_t index)
if bitRead(Counter.pin_state, index) {
// PWMfrequency 100
// restart PWM each second (german 50Hz has to up to 0.01% deviation)
// set COUNTERDEBOUNCELOW 1 to catch the raising edge
// Zero-HIGH is typical 2ms
if (bitRead(Counter.pin_state, index) && Settings.flag4.zerocross_dimmer) {
if (RtcSettings.pulse_counter[index]%100 == 0 && PinUsed(GPIO_PWM1, index) && Settings.flag4.zerocross_dimmer) {
const uint32_t current_cycle = ESP.getCycleCount();
// stop pwm on PIN to start in Sync with rising edge
// calculate timeoffset to fire PWM