Tool/software: Code Composer Studio
Hi,
I wrote a very simple program in CCS as follows. However, when I try to build it, the CCS 7 said: "error #237: variable "HRCap1Regs" was declared with a never-completed type". Could anyone tell me how to solve the issue?
Thanks,
#include "F2806x_Device.h"
#include "F2806x_PieVect.h"
void DelayUs(unsigned int z);
int16 flg = 0;
void main(void)
{
//--- watchdog
asm(" EALLOW");
SysCtrlRegs.WDCR = 0x0068;
asm(" EDIS");
//---------------------------------------------------------------------------------
//--- initialize GPIO:
asm(" EALLOW");
// Set the Multiplexers
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0; // 0=GPIO 1=EPWM1A 2=rsvd 3=rsvd;
GpioCtrlRegs.GPADIR.bit.GPIO0 = 1; // 1=OUTput, 0=INput
GpioDataRegs.GPACLEAR.bit.GPIO0 = 1; // uncomment if --> Set Low initially
// GpioDataRegs.GPASET.bit.GPIO0 = 1; // uncomment if --> Set High initially
GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 0; // 0=GPIO 1=EPWM1B 2=rsvd 3=COMP1OUT;
GpioCtrlRegs.GPADIR.bit.GPIO1 = 1; // 1=OUTput, 0=INput
GpioDataRegs.GPACLEAR.bit.GPIO1 = 1; // uncomment if --> Set Low initially
// GpioDataRegs.GPASET.bit.GPIO1 = 1; // uncomment if --> Set High initially
asm(" EDIS");
//---------------------------------------------------------------------------------
//--- initialize f_{clk} = f_{osc}/1 = 10 MHz
// If PLL is used, Figure 1-24. PLLCR Change Procedure Flow Chart needs to be considered and the relevant registers need to be set.
asm(" EALLOW");
SysCtrlRegs.PLLCR.bit.DIV = 0; // PLL is bypassed;
SysCtrlRegs.PLLSTS.bit.DIVSEL = 0x3; // f_{clk} = f_{osc}/1
asm(" EDIS");
while(1)
{
if(flg == 1)
{
DelayUs(200);
GpioDataRegs.GPASET.bit.GPIO0 = 1;
DelayUs(10);
GpioDataRegs.GPASET.bit.GPIO1 = 1;
DelayUs(15);
GpioDataRegs.GPACLEAR.bit.GPIO1 = 1;
DelayUs(5);
GpioDataRegs.GPASET.bit.GPIO1 = 1;
DelayUs(5);
GpioDataRegs.GPACLEAR.bit.GPIO1 = 1;
flg = 0;
GpioDataRegs.GPASET.bit.GPIO0 = 0;
}
}
}
void DelayUs(unsigned int z)
{
unsigned int i,j;
for(i=z;i>0;i--)
for(j=100;j>0;j--);
}