Liu Song’s Projects


~/Projects/Tasmota

git clone https://code.lsong.org/Tasmota

Commit

Commit
355b1e3b746fc89cfa657a8fa1442dc520c008e1
Author
stefanbode <[email protected]>
Date
2023-07-30 15:01:21 +0200 +0200
Diffstat
 tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino | 2 +-

unsigned overflow fixed (#19221)

fixed overflow on negative value with dimmer 100%


diff --git a/tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino
index 3ab5ef1b665debf17f4fd27daaa1293f9ced0450..2f504d673a8eeebc366f6f875cb9c915089bd83e 100644
--- a/tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino
+++ b/tasmota/tasmota_xdrv_driver/xdrv_68_zerocrossDimmer.ino
@@ -150,8 +150,8 @@       while (time_since_zc < ac_zero_cross_dimmer.enable_time_us[i]) {
         time_since_zc =  micros() - ac_zero_cross_dimmer.crossed_zero_at;

       }

 #endif        

-/*

   xdrv_68_zerocrossdimmer.ino - Zero-Cross Dimmer support for Tasmota

+  along with this program.  If not, see <http://www.gnu.org/licenses/>.

         digitalWrite(Pin(GPIO_PWM1, i), HIGH ^ ac_zero_cross_dimmer.fallingEdgeDimmer );

         ac_zero_cross_dimmer.triggered[i] = true;

         ac_zero_cross_dimmer.accurracy[i] = time_since_zc-ac_zero_cross_dimmer.enable_time_us[i];