This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

28335加入DELAY_US就会出错

编译没有问题,但是只要加入DELAY_US(100),想实现的功能就实现不了。连矩阵按键控制LED灯亮灭都不行,主函数代码如下:

#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File

#include "leds.h"
#include "key.h"


/*******************************************************************************
* 函 数 名 : main
* 函数功能 : 主函数
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
void main()
{
int i= 0;
char key = 0;

InitSysCtrl();

LED_Init();
KEY_Init();

while(1)
{
key = KEY_Scan(0);

switch(key)
{
case KEY1_PRESS: LED2_TOGGLE;break;
case KEY2_PRESS: LED3_TOGGLE;break;
case KEY3_PRESS: LED4_TOGGLE;break;
case KEY4_PRESS: LED5_TOGGLE;break;
case KEY5_PRESS: LED6_TOGGLE;break;
case KEY6_PRESS: LED7_TOGGLE;break;
}

i++;
if(i==2000)
{
i = 0;
LED1_TOGGLE;
}
DELAY_US(100);

}
}