Other Parts Discussed in Thread: C2000WARE, SYSCONFIG
.syscfg文件中CAN配置:
can1.$name = "CAN"; can1.enableInterrupt = true; can1.interruptFlags = ["CAN_INT_ERROR","CAN_INT_IE0","CAN_INT_IE1","CAN_INT_STATUS"]; can1.interruptLine = ["CAN_GLOBAL_INT_CANINT0","CAN_GLOBAL_INT_CANINT1"]; can1.can.$assign = "CANA"; can1.can.can_rxPin.$assign = "GPIO30"; can1.can.can_txPin.$assign = "GPIO31";
生成borad.c文件中CAN初始化代码:
void CAN_init(){ //CAN initialization CAN_initModule(CAN_BASE); // Refer to the Driver Library User Guide for information on how to set // tighter timing control. Additionally, consult the device data sheet // for more information about the CAN module clocking. // CAN_setBitRate(CAN_BASE, DEVICE_SYSCLK_FREQ, 500000, 20); // Enable CAN Interrupts CAN_enableInterrupt(CAN_BASE, CAN_INT_ERROR|CAN_INT_IE0,CAN_INT_IE1,CAN_INT_STATUS); CAN_enableGlobalInterrupt(CAN_BASE, CAN_GLOBAL_INT_CANINT0); CAN_enableGlobalInterrupt(CAN_BASE, CAN_GLOBAL_INT_CANINT1); }
C2000WARE中CAN_enableInterrupt原型:
static inline void CAN_enableInterrupt(uint32_t base, uint32_t intFlags);
Sysconfig生成的board.c文件与C2000WARE的CAN_enableInterrupt不对应。导致编译错误。
编译错误提示: