mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Attempt to fix Dali core 3 compilation (#22214)
This commit is contained in:
parent
19d3984d6e
commit
5d4230d39b
@ -78,7 +78,8 @@ struct DALI {
|
|||||||
* @param None
|
* @param None
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void IRAM_ATTR DALI_Tick_Handler(void)
|
void IRAM_ATTR DALI_Tick_Handler(void);
|
||||||
|
void DALI_Tick_Handler(void)
|
||||||
{
|
{
|
||||||
if (getDaliFlag() == DALI_RECEIVING_DATA)
|
if (getDaliFlag() == DALI_RECEIVING_DATA)
|
||||||
{
|
{
|
||||||
@ -97,7 +98,8 @@ void IRAM_ATTR DALI_Tick_Handler(void)
|
|||||||
*/
|
*/
|
||||||
void enableDaliRxInterrupt() {
|
void enableDaliRxInterrupt() {
|
||||||
Dali->flag = DALI_NO_ACTION;
|
Dali->flag = DALI_NO_ACTION;
|
||||||
timerAlarmDisable(Dali->timer);
|
// timerAlarmDisable(Dali->timer);
|
||||||
|
timerStop(Dali->timer);
|
||||||
attachInterrupt(Pin(GPIO_DALI_RX), receiveDaliData, FALLING);
|
attachInterrupt(Pin(GPIO_DALI_RX), receiveDaliData, FALLING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +109,8 @@ void enableDaliRxInterrupt() {
|
|||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void disableRxInterrupt() {
|
void disableRxInterrupt() {
|
||||||
timerAlarmEnable(Dali->timer);
|
// timerAlarmEnable(Dali->timer);
|
||||||
|
timerStart(Dali->timer);
|
||||||
detachInterrupt(Pin(GPIO_DALI_RX));
|
detachInterrupt(Pin(GPIO_DALI_RX));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,9 +386,18 @@ void DaliPreInit() {
|
|||||||
AddLog(LOG_LEVEL_INFO, PSTR("DLI: Memory allocation error"));
|
AddLog(LOG_LEVEL_INFO, PSTR("DLI: Memory allocation error"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Dali->timer = timerBegin(DALI_TIMER, 13, true);
|
// Dali->timer = timerBegin(DALI_TIMER, 13, true);
|
||||||
timerAttachInterrupt(Dali->timer, &DALI_Tick_Handler, true);
|
Dali->timer = timerBegin(12307692); // 160MHz????? / 13
|
||||||
timerAlarmWrite(Dali->timer, 641, true);
|
if (nullptr == Dali->timer) {
|
||||||
|
AddLog(LOG_LEVEL_INFO, PSTR("DLI: Bad timer init"));
|
||||||
|
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);
|
attachInterrupt(Pin(GPIO_DALI_RX), receiveDaliData, FALLING);
|
||||||
enableDaliRxInterrupt();
|
enableDaliRxInterrupt();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user