2019-03-24 11:13发布
qinkaiabc 发表于 2014-7-25 23:28 楼主参考的帖子没仔细看哟 extern Uint16 RamfuncsLoadStart;
最多设置5个标签!
extern Uint16 RamfuncsLoadStart;
extern Uint16 RamfuncsLoadEnd;
extern Uint16 RamfuncsRunStart;
/*
* main.c
*/
/* GPIO0,1,2,3 --> LED
*
*/
/////////////////////////////////////////////////////////
// Header include
#include "DSP28x_Project.h"
//#include "stdio.h"
char * rxch = "XYZ";
extern struct TXDATASTRUCT rxdata;
/////////////////////////////////////////////////////////
// defined
#ifdef TOFLASH
extern void MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr);
extern Uint16 RamfuncsLoadStart;
extern Uint16 RamfuncsLoadEnd;
extern Uint16 RamfuncsRunStart;
#endif
void main(void)
{
// Uint16 a;
InitSysCtrl();
InitGpio();
InitSciaGpio();
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
#ifdef TOFLASH
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
InitFlash();
#endif
rxdata.pCh = "ABC";
rxdata.pos = 0;
scia_fifo_init();
InitCpuTimers();
InitEPwm1();
ConfigCpuTimer(&CpuTimer0, 60, 500000);
ConfigCpuTimer(&CpuTimer1, 60, 1000);
CpuTimer0Regs.TCR.all = 0x4001; // Use write-only instruction to set TSS bit = 0
CpuTimer1Regs.TCR.all = 0x4001; // start
IER |= M_INT1; // timer0
IER |= M_INT9; // SCI
IER |= M_INT13; // timer1
PieCtrlRegs.PIEIER1.bit.INTx7 = 1; // timer0 (1.7)
//PieCtrlRegs.PIEIER9.bit.INTx1 = 1; // SCI RX interrupt
PieCtrlRegs.PIEIER9.bit.INTx2 = 1; // SCI TX interrupt
//PieCtrlRegs
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
for (;;)
{
DELAY_US(400000L);
DELAY_US(400000L);
DELAY_US(400000L);
DELAY_US(400000L);
uart_sendstring("EEWorld_ ");
GpioDataRegs.GPATOGGLE.bit.GPIO2 = 1;
}
}
F28027.cmd文件修改了没?
一周热门 更多>