请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320F28379D 工具与软件:
大家好、我刚刚接触 TI 的 MCU、我正尝试使用以下程序从 MCP 2515发送一条 CAN 消息。 我确定将_LAUNCHXL_F28379D 定义为我的预定义符号、并且我在下面附上了相关代码和我的.syscfg 文件的副本。 我已尝试查看 sprace5a 中提供的调试提示;但是、我尚未找到任何可以解决我的问题的方法。 非常感谢您的帮助。
//
// Included Files
//
#include "board.h"
#include "c2000ware_libraries.h"
volatile unsigned int recievedData = 0;
//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Disable pin locks and enable internal pull-ups.
//
Device_initGPIO();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// PinMux and Peripheral Initialization
//
Board_init();
//
// C2000Ware Library initialization
//
C2000Ware_libraries_init();
//
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
//
EINT;
ERTM;
CAN_startModule(myCAN0_BASE);
uint16_t rxMsgData[8];
while(1)
{
if (CAN_readMessage(myCAN0_BASE, 2, rxMsgData))
recievedData = 1;
}
}
//
// End of File
//