#include "DSP281x_Device.h" // DSP281x Headerfile Include File
#include "DSP281x_Examples.h" // DSP281x Examples Include File
#include "f2812a.h"
// 定义指示灯控制寄存器地址和寄存器类型
#define LBDS (*((unsigned int *)0xc0000))
// 定义拨码开关控制寄存器地址和寄存器类型
#define DIPS (*(unsigned int *)0xc0001)
main()
{
int M;
InitSysCtrl(); // 初始化DSP运行时钟
while(1)
{
M=DIPS;
switch(M)
case 0 : LBDS=0;
case 1 : LBDS=1;
case 2 : LBDS=2;
case 4 : LBDS=4;
case 8 : LBDS=8;
}
}
报错;"dip.c", line 22: error: a case label may only be used within a switch |