在main.c文件下写入main.c文件下:
int main(void)
{
// 驱动库版本
Version();
// 中断驱动库版本
VersionI();
// 取得芯片型号
DSPChipType = DSPTypeGet();
// 外设初始化
PeriphInit();
// 主循环
for(;;)
{
// 亦可以使用查询法查询中断状态
if(Flag)
{
if(DSPChipType == DSP_C6678)
{
// 延时(非精确)
Delay(0x00FFFFFF);
LEDControl(CoreLED1, LED_ON);
LEDControl(CoreLED2, LED_OFF);
LEDControl(BoardLED1, LED_OFF);
// 延时(非精确)
Delay(0x00FFFFFF);
LEDControl(CoreLED1, LED_OFF);
LEDControl(CoreLED2, LED_ON);
LEDControl(BoardLED1, LED_OFF);
// 延时(非精确)
Delay(0x00FFFFFF);
LEDControl(CoreLED1, LED_OFF);
LEDControl(CoreLED2, LED_OFF);
LEDControl(BoardLED1, LED_ON);
}
else if(DSPChipType == DSP_C6654 || DSPChipType == DSP_C6655 || DSPChipType == DSP_C6657)
{
Delay(0x00FFFFFF);
LEDControl(BoardLED_D3, LED_ON);
LEDControl(BoardLED_D5, LED_OFF);
LEDControl(BoardLED_D7, LED_OFF);
// 延时(非精确)
Delay(0x00FFFFFF);
LEDControl(BoardLED_D3, LED_OFF);
LEDControl(BoardLED_D5, LED_ON);
LEDControl(BoardLED_D7, LED_OFF);
Delay(0x00FFFFFF);
LEDControl(BoardLED_D3, LED_OFF);
LEDControl(BoardLED_D5, LED_OFF);
LEDControl(BoardLED_D7, LED_ON);
}
}
}
}
点击编译的那个小锤子: