(涉及DSP)CCS编译程序时发现有错误,但不知道哪里有问题,请大佬们帮忙!
#include "DSP28x_Project.h"// Device Headerfile and Examples Include File#define EXAMPLE1 1
#define EXAMPLE2 0
#define EXAMPLE3 0
void delay_loop(void);
void Gpio_select(void);
void Gpio_example1(void);
void Gpio_example2(void);
void Gpio_example3(void);
void main(void)
{ InitSysCtrl();
Gpio_select();
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
#if EXAMPLE1
Gpio_example1();
#endif
#if EXAMPLE2
Gpio_example2();
#endif
#if EXAMPLE3
Gpio_example3();
#endif
}
void delay_loop()
{ short i;
for(i = 0;i = 5000;i++){}
}
void Gpio_example1(void)
{
if(GpioDataRegs.GPBSET.bit.GPIO32 = 1)
{
for(;;)
{
GpioDataRegs.GPADAT.all = 0x000000FE;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000FD;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000FB;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000F9;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000EF;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000DF;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000BF;
delay_loop();
GpioDataRegs.GPADAT.all = 0x0000009F;
delay_loop();
}
}
else
{ for(;;)
{
GpioDataRegs.GPADAT.all = 0x0000009F;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000BF;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000DF;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000EF;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000F9;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000FB;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000FD;
delay_loop();
GpioDataRegs.GPADAT.all = 0x000000FE;
delay_loop();
}
}
}
void Gpio_example2(void)
{
}
void Gpio_example3(void)
{
GpioDataRegs.GPASET.all = 0xAAAAAAAA;
GpioDataRegs.GPACLEAR.all = 0x55555555;
GpioDataRegs.GPBSET.all = 0x0000000A;
GpioDataRegs.GPBCLEAR.all = 0x00000005;
for(;;)
{
GpioDataRegs.GPATOGGLE.all = 0xFFFFFFFF;
GpioDataRegs.GPBTOGGLE.all = 0x0000000f;
delay_loop();
}
}
void Gpio_select(void)
{
EALLOW;
GpioDataRegs.GPAMUX1.all = 0x00000000;
GpioDataRegs.GPAMUX2.all = 0x00000000;
GpioDataRegs.GPBMUX1.bit.GPIO32 = 0;
GpioDataRegs.GPADIR.all = 0xFFFFFFFF;
GpioDataRegs.GPBDIR.bit.GPIO32 = 0;
EDIS;
}
//=================================
================================//
错误信息如图
页:
[1]