This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好!
我尝试使用 Energia 和 TivaWare 库对 TM4C1294NCPDT 进行编程。 我的 TivaWare 版本为: TivaWare_C_Series-2.1.4.178。
我尝试使用 IntEnable()函数在 TIMER0A 超时时启用中断。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define PART_TM4C1294NCPDT
int speedFactor = 0;
void setup(){
TimerConfigure (TIMER0_BASE、(TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PERIODICASE));
TimerPrescaleSet (TIMER0_BASE、TIMER_A、1);//Prescaler 为1/2。
TimerLoadSet (TIMER0_BASE、TIMER_A、(30720>>speedFactor));
//定时器从装载值开始递减计数
/*启用中断,并注册中断处理程序*/
//启用处理器中断
IntMasterEnable();
// Timer0A 超时中断
TimerIntEnable (TIMER0_BASE、TIMER_TINA_TIMEOUT);
//在处理器上启用 Timer0A 中断
IntEnable (INT_TIMER0A);
/*注册计时器中断处理程序:计时器时要执行的函数
超时。*/
TimerIntRegister (TIMER0_BASE、TIMER_A、Timer0AIntHandler);
}
当我运行这个时、我得到错误:'INT_TIMER0A'未在这个范围内声明。
我通读了 TivaWare 指南,它说这些 INT_*值是根据使用的部件定义的,与 GPIO 引脚类似。 浏览完头文件后,我无法在 interrupt.h 文件或其它任何地方找到 INT_*值的定义。 是否缺少中断映射头文件?
您好、Charles、
感谢您的快速回复。 我有预定义的名称。
此外、我还应该提到、我已经使用过 GPIO 引脚宏、并且没有任何问题。