#include "inc/DSP28_Device.h"
#include "inc/DSP28_GlobalPrototypes.h"
#define uint unsigned int
#define uchar unsigned char
uint ct;
uint *led= (unsigned int *)0x4100;
interrupt void cpu_timer0_handler(void)
{
//*led=~(*led);
if((ct++)&2)
*led=0xff;
else
*led=0x00;
PieCtrl.PIEACK.all=PIEACK_GROUP1 ;
}
void main(void)
{
InitSysCtrl();
DINT;
InitPieVectTable();
InitPieCtrl();
EALLOW;
PieVectTable.TINT0=&cpu_timer0_handler;
EDIS;
InitCpuTimers();
ConfigCpuTimer(&CpuTimer0,50,1000000);
StartCpuTimer0();//可以在DSP28_TIMeR文件中找到原型
IER |=M_INT1;
PieCtrl.PIEIER1.bit.INTx7=1;
EINT;
while(1);
}
timer0.zip
(730.91 KB)
出息问题的
>> warning: creating .stack section with default size of 400 (hex) words.
Use
-stack option to change the default size.
解决方案:在build property中找到link Stacte Size(-stact):填入800或者其他小于1024的数值这样就不会出现警告了! |