仿真编译以及运行均正常,要进行烧写时进行Release编译时报错,不明白。。。向各位求助了。
<Linking>
>> C:DOCUME~1ADMINI~1LOCALS~1TempTI8763, line 20: error:
can't find input file 'E:/DSPCODE/F2812/usb_out/include'
>> Compilation failure
Build Complete,
2 Errors, 0 Warnings, 0 Remarks.
以下是我的main.c
#include "DSP281x_Device.h"
#include "DSP281x_Examples.h"
#pragma CODE_SECTION(InitFlash,"ramfuncs")
extern unsigned int RamfuncsLoadStart;
extern unsigned int RamfuncsLoadEnd;
extern unsigned int RamfuncsRunStart;
Uint16 CODE[3];
int k;
void Send_SPIA(unsigned char temp);
void InitUSB(void);
void InitCS(void);
void ClearCODE(void);
void delay(unsigned long t);
void FlashLED(void);
void main(void)
{
int i =0;
InitSysCtrl();
memcpy(&RamfuncsRunStart,
&RamfuncsLoadStart,
&RamfuncsLoadEnd-&RamfuncsLoadStart);
InitFlash();
InitSpi();
InitUSB();
InitCS();
ClearCODE();
FlashLED();
for(;;)
{
if(GpioDataRegs.GPADAT.bit.GPIOA8 ==1) //empty==1
{
GpioDataRegs.GPADAT.bit.GPIOA1 =0; //SLOE=0
GpioDataRegs.GPADAT.bit.GPIOA2 =0; //SLRD=0
delay(10);
CODE[i]=GpioDataRegs.GPBDAT.all&0x00ff; //GPIOB[0:7]---PB[0:7]
GpioDataRegs.GPADAT.bit.GPIOA2 =1; //SLRD=1
GpioDataRegs.GPADAT.bit.GPIOA1 =1; //SLOE=1
i++;
if(i==3)
{
if((CODE[2]&0x01)!=0) //片选CS
{
GpioDataRegs.GPADAT.bit.GPIOA11 =0;
}
if((CODE[2]&0x02)!=0)
{
GpioDataRegs.GPADAT.bit.GPIOA12 =0;
}
for(k=0;k<3;k++)//循环发送3个8bit数据
{
Send_SPIA(CODE[k]); //发送数据函数
}
delay(100);
GpioDataRegs.GPADAT.bit.GPIOA11 =1;
GpioDataRegs.GPADAT.bit.GPIOA12 =1;
i=0;
}
}
}
}
/*------------------------------------------*/
/*形式参数:void */
/*返回值:void */
/*函数描述:初始化usb设置 */
/*------------------------------------------*/
void InitUSB(void)
{
EALLOW;
GpioMuxRegs.GPAMUX.all=0;
GpioMuxRegs.GPBMUX.all=0;
GpioMuxRegs.GPBDIR.all=0;//GPIOB[0:15]作为USB数据输入端口
GpioMuxRegs.GPADIR.bit.GPIOA1=1;
GpioMuxRegs.GPADIR.bit.GPIOA2=1;
GpioMuxRegs.GPADIR.bit.GPIOA3=1; //设置端口方向
GpioMuxRegs.GPADIR.bit.GPIOA4=1;
GpioMuxRegs.GPADIR.bit.GPIOA5=1;
GpioMuxRegs.GPADIR.bit.GPIOA6=0;//FLAGA prog
GpioMuxRegs.GPADIR.bit.GPIOA7=0;//FLAGB full
GpioMuxRegs.GPADIR.bit.GPIOA8=0;//FLAGC empty
EDIS;
GpioDataRegs.GPADAT.bit.GPIOA1 =1;//SLOE
GpioDataRegs.GPADAT.bit.GPIOA2 =1;//SLRD
GpioDataRegs.GPADAT.bit.GPIOA3 =1;//SLWR
/*设定EP2-----------------------------------*/
GpioDataRegs.GPADAT.bit.GPIOA4 =0;
GpioDataRegs.GPADAT.bit.GPIOA5 =0;
}
/*------------------------------------------*/
/*形式参数:void */
/*返回值:void */
/*函数描述:片选设置 */
/*------------------------------------------*/
void InitCS(void)
{
EALLOW;
GpioMuxRegs.GPADIR.bit.GPIOA11=1;//CS1
GpioMuxRegs.GPADIR.bit.GPIOA12=1;//CS2
GpioMuxRegs.GPADIR.bit.GPIOA14=1;//RESET
EDIS;
GpioDataRegs.GPADAT.bit.GPIOA11 =1;
GpioDataRegs.GPADAT.bit.GPIOA12 =1;
GpioDataRegs.GPADAT.bit.GPIOA14 =1;
GpioDataRegs.GPATOGGLE.bit.GPIOA14 =1;
delay(100);
GpioDataRegs.GPATOGGLE.bit.GPIOA14 =1;
}
/*------------------------------------------*/
/*形式参数:void */
/*返回值:void */
/*函数描述:初始化AD设置 */
/*------------------------------------------*/
void ClearCODE(void)
{
for(k=0;k<3;k++)
{
CODE[k]=0;
}
}
/*------------------------------------------*/
/*形式参数:void */
/*返回值:void */
/*函数描述:led闪烁 */
/*------------------------------------------*/
void FlashLED(void)
{
EALLOW;
GpioMuxRegs.GPADIR.bit.GPIOA15=1;//LED
EDIS;
GpioDataRegs.GPADAT.bit.GPIOA15 =1;
delay(1000);
GpioDataRegs.GPATOGGLE.bit.GPIOA15 =1;
delay(1000);
GpioDataRegs.GPATOGGLE.bit.GPIOA15 =1;
delay(1000);
GpioDataRegs.GPATOGGLE.bit.GPIOA15 =1;
delay(1000);
GpioDataRegs.GPATOGGLE.bit.GPIOA15 =1;
}
/*------------------------------------------*/
/*形式参数:char */
/*返回值:void */
/*函数描述:通过SPI发送数据 */
/*------------------------------------------*/
void Send_SPIA(unsigned char temp)
{
if ( SpiaRegs.SPISTS.bit.BUFFULL_FLAG == 0)//检测缓冲器是否为空
{
SpiaRegs.SPITXBUF = temp<<8;
}
while( SpiaRegs.SPISTS.bit.BUFFULL_FLAG == 1){;}//检测数据是否发送完毕
}
/*------------------------------------------*/
/*形式参数:long */
/*返回值:void */
/*函数描述:延时函数 */
/*------------------------------------------*/
void delay(unsigned long t)
{
while(t>0)
t--;
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
debug倒是没问题,是我自己把release的bulid options设置错了
一周热门 更多>