From 2d80f87fc9b1d5a3ab5f56981df46a0db7cb7948 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:50:15 +0200 Subject: [PATCH] Attempt 2 to fix Dali core 3 compilation (#22214) --- tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino b/tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino index 86a5ced0f..a739f46bd 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_89_esp32_dali.ino @@ -386,17 +386,20 @@ void DaliPreInit() { AddLog(LOG_LEVEL_INFO, PSTR("DLI: Memory allocation error")); return; } +// Arduino Core < 3 // Dali->timer = timerBegin(DALI_TIMER, 13, true); - Dali->timer = timerBegin(12307692); // 160MHz????? / 13 +// timerAttachInterrupt(Dali->timer, &DALI_Tick_Handler, true); +// timerAlarmWrite(Dali->timer, 641, true); + +// Arduino Core > 3 + Dali->timer = timerBegin(6153846); // 80MHz / 13 if (nullptr == Dali->timer) { - AddLog(LOG_LEVEL_INFO, PSTR("DLI: Bad timer init")); + AddLog(LOG_LEVEL_INFO, PSTR("DLI: No timer available")); free(Dali); Dali = nullptr; return; } -// timerAttachInterrupt(Dali->timer, &DALI_Tick_Handler, true); timerAttachInterrupt(Dali->timer, &DALI_Tick_Handler); -// timerAlarmWrite(Dali->timer, 641, true); timerAlarm(Dali->timer, 641, true, 0); attachInterrupt(Pin(GPIO_DALI_RX), receiveDaliData, FALLING);