一個控制定時器0中斷,一個控制定時器1中斷,遇到問題是兩個中斷不能同事存在,想了解是什么問題
描述問題
定時器0和1兩個中斷同時存在,不能進行編譯,只有一個中斷存(另一個需要注解)在才可以,這是為什么?
well its a bad idea in most cases to call functions inside irq routines. This is especially true wenn you are using the using xx clause. In your case its even more bad since you are using aTimer_x_SetData in main context as well as in irq timer0 context.?
This should produce at least a warning.
I dont see any TF0=0; or TF1=0; insite the IRQ routines to clear that irq flags. Therefore T0 irq is called again and again.
@usbman,CH552's time irq flag can be clear automaticly when jump into irq function,as described in the manual.
不能進行編譯和編譯出錯是兩種情況,我們關(guān)注一下錯誤信息。
編譯軟件不會關(guān)心代碼直接是否對應(yīng)現(xiàn)實運行結(jié)果。只要沒有語法錯誤,就應(yīng)該能夠編譯。
所以請確認
已經(jīng)解決了