Skip to content

Commit 43f4fad

Browse files
committed
Fix DALI ESP32-S3 timing
- Fix ESP8266 DALI exception due to LittleFs issue
1 parent f216590 commit 43f4fad

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/default/TasmotaDali/src/TasmotaDali.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void TasmotaDali::write(DaliFrame frame) {
9292
if (frame.meta & TM_DALI_SEND_TWICE) {
9393
SendData(frame); // Takes 14.7 ms
9494
}
95-
delay(2); // Block response
95+
delay(1); // Block response
9696
EnableRxInterrupt();
9797
}
9898

tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,9 @@ void Energy200ms(void) {
677677
Energy->Settings.energy_export_kWh[i] = RtcEnergySettings.energy_export_kWh[i];
678678

679679
Energy->period_kWh[i] -= RtcEnergySettings.energy_today_kWh[i]; // this becomes a large unsigned, effectively a negative for EnergyShow calculation
680-
Energy->kWhtoday[i] = 0;
680+
Energy->kWhtoday[i] = Energy->kWhtoday[i] % 100; // Roll fractional watt-hours into the next day since kWhtotal truncates to watt-hours.
681681
Energy->energy_today_offset_kWh[i] = 0;
682-
RtcEnergySettings.energy_today_kWh[i] = 0;
682+
RtcEnergySettings.energy_today_kWh[i] = Energy->kWhtoday[i];
683683
Energy->Settings.energy_today_kWh[i] = 0;
684684

685685
Energy->start_energy[i] = 0;

tasmota/tasmota_xdrv_driver/xdrv_75_dali.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,10 @@ void DaliLoop(void) {
761761
}
762762
Dali->light_sync = true; // Block local loop
763763
if (any_color) {
764+
if (Settings->save_data) {
765+
// Postpone save_data during fast color changes which results in exception 0 on ESP8266
766+
TasmotaGlobal.save_data_counter = 4;
767+
}
764768
char scmnd[20];
765769
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_COLOR " %s"), scolors);
766770
ExecuteCommand(scmnd, SRC_SWITCH);

0 commit comments

Comments
 (0)