在CCS3.3中建了一个C6746的工程,在头文件中定义了相关寄存器
extern cregister volatile Uint32 AMR; /* Address Mode Register */
extern cregister volatile Uint32 CSR; /* Interrupt Return Pointer */
extern cregister volatile Uint32 IFR; /* Interrupt Flag Register */
extern cregister volatile Uint32 ISR; /* Interrupt Set Register */
extern cregister volatile Uint32 ICR; /* Interrupt Clear Register */
extern cregister volatile Uint32 IER; /* Interrupt Enable Register */
extern cregister volatile Uint32 ISTP; /* Interrupt Service Tbl Ptr */
extern cregister volatile Uint32 ITSR; /* Interrupt Task State Register */
extern cregister volatile Uint32 IRP; /* Interrupt Return Pointer */
extern cregister volatile Uint32 NRP; /* Non-maskable Int Return Ptr*/
在中断中希望对相关寄存器进行保护
Uint32 irp,csr,ier,itsr;
irp = IRP;/* Interrupt Return Pointer */
csr = CSR;/* Interrupt Return Pointer */
itsr = ITSR;/* Interrupt Task State Register */
ier = IER;/* Interrupt Enable Register */
IER = ier & (~(1<<6));//determine which interrupts should be allowed to pre-empt
CSR = csr | 1;//enable global interrupt
但是编译的时候会报INTERNAL ERROR: no match for ASG ( irp = IRP;/* Interrupt Return Pointer */这一行)
如果将上面头文件中的定义数据类型Uint32改为Uint16则不会报错,但是上面的寄存器应该都是32位的,改为16位的应该会有问题。
报错的原因在哪?报的这个错误是什么?各位大侠有什么解决方法吗?
谢谢了!
此帖出自
小平头技术问答
一周热门 更多>