Warning/error on an empty line

Hi,

I’m using DC 9.62 with a RCM2250. At compile time I’m getting those messages:

line 1: WARNING xxxxxxx.c : Insufficient arguments.
line 1: ERROR xxxxxxx.c : Missing character ‘;’.

After those two, there is a bunch of Unmatched ‘{’.

I’m new to Dynamic C and I guess it is a simple config problem but I didn’t found any help in the documentation yet.

How can I get around those warning/error?

Thanks

Hugo

Can you show us the code that is producing the errors? Is the codes produced in a library or in your main code. This is indicated by the xxxxx.c you blanked out.

Here is the begining part of my code. I skiped the functions definition to shorten the post.

begin here:

/*****************************************************

 MAX1464MExploitation.c

 Description:

******************************************************/
// Prototypes

void addrdatainput(int x, int y, char page, char ADCS);
void page_to_be_erase(char part, char ADCS);

root unsigned int AdcSerialDriver(unsigned char cmd, unsigned char cmda, unsigned char len, unsigned char ADCS);
unsigned char MemReadWrite(unsigned char rdwr,unsigned char addrlb,
unsigned char addrhb,unsigned char dbyte, unsigned char CS);
void FlashMemAddCoding(unsigned char memadlb,unsigned char memadhb,unsigned char bytelenght, unsigned char CS);
void AnalogModesOff(unsigned char CS);
void PageAddressCode(unsigned char Page_Number, unsigned char CS);
void DataToWrite(unsigned char DataByte,unsigned char bytelenght,unsigned char CS);
void Delay4ms();
int ChanAdcRead(unsigned char chan_number);
int ChanTempRead(unsigned char chan_number);
int ChanDacWrite(unsigned char chan_number, int dac_data);
int ChanPwmWrite(unsigned char chan_number, int pwm_data);
int ConverterChipTempRead(unsigned char chip_number);
int McrWrite(unsigned char chip_number, int mcr_data, int mcr_reg);
int McrRead(unsigned char chip_number, int mcr_reg);
int CPUportread(unsigned char chip_number,unsigned char cpu_port_name);
int CPUportWrite(unsigned char chip_number, int cpu_port_data, unsigned char cpu_port_name);
int ReadCpuAccum(unsigned char chip_number);
int ReadCpuPC(unsigned char chip_number);
int ResetCpuPC(unsigned char chip_number);
int str2hex(char *str);

char lenght;

#define AD16BITS 0
#define AD8BITS 1
#define CPUportGP0 0x04
#define CPUportGP1 0x14
#define CPUportGP2 0x24
#define CPUportGP3 0x34
#define CPUportGP4 0x44
#define CPUportGP5 0x54
#define CPUportGP6 0x64
#define CPUportGP7 0x74
#define CPUportGP8 0x84
#define CPUportGP9 0x94
#define CPUportGPA 0xa4
#define CPUportGPB 0xb4
#define CPUportGPC 0xc4
#define CPUportD 0xd4
#define CPUportE 0xe4
#define CPUportF 0xf4

/*****************************************************************************/
static const module_reg_add[92]={0x03,0x02,0x01,0x00, /ADC_Control 0/
0x03,0x02,0x01,0x10, /ADC_Data_1 4/
0x03,0x02,0x01,0x20, /ADC_Config_1A 8/
0x03,0x02,0x01,0x30, /ADC_Config_1B 12/
0x03,0x02,0x01,0x40, /ADC_Data_2 16/
0x03,0x02,0x01,0x50, /ADC_Config_2A 20/
0x03,0x02,0x01,0x60, /ADC_Config_2B 24/
0x03,0x02,0x01,0x70, /ADC_Data_T 28/
0x03,0x02,0x01,0x80, /ADC_Congig_TA 32/
0x03,0x02,0x01,0x90, /ADC_Config_TB 36/
0x03,0x02,0x11,0x00, /DOP1_Data 40/
0x03,0x02,0x11,0x10, /DOP1_Control 44/
0x03,0x02,0x11,0x20, /DOP1_Confog 48/
0x03,0x02,0x11,0x30, /DOP2_Data 52/
0x03,0x02,0x11,0x40, /DOP2_Control 56/
0x03,0x02,0x11,0x50, /DOP2_Config 60/
0x03,0x02,0x31,0x00, /OPAmp_Config 64/
0x03,0x02,0x21,0x10, /TMR_Control 68/
0x03,0x02,0x31,0x30, /TMR_Config 72/
0x03,0x02,0x31,0x10, /PWR_ON_Control 76/
0x03,0x02,0x31,0x20, /OSC_Control 80/
0x03,0x02,0x41,0x00, /GPIO1_Control 84/
0x03,0x02,0x41,0x10}; /GPIO2_Control 88/

void main()
{
static const chip_list[6]={0x01,0x02,0x04,0x08,0x10,0x20};
auto char Lbyte, Hbyte, Mem_cmd, chip_select;
unsigned int compt, compt2, add_cmpt, rawdata;
unsigned long int buf, checksum;
char Valeur[4];
brdInit();

while(Mem_cmd!=‘q’)
{
compt=0x0000;
compt2=0x00;
Lbyte=0x00;
Hbyte=0x00;
Mem_cmd=0xff;
while(Mem_cmd>0x35||Mem_cmd<0x30)
{
printf("

Write the chip select address…:(0 to 5)
“);
Mem_cmd=getchar();
}
chip_select=chip_list[(Mem_cmd-0x30)];
printf(”

Ok chip selected is: %d",(Mem_cmd-48));
printf("

Read content of partition 0…:a
“);
printf(”
Write data at address in partition 0…:b
“);
printf(”
Read content of partition 1…:c
“);
printf(”
Write data at address in partition 1…:d
“);
printf(”
Erase content of partition 0…:e
“);
printf(”
Erase content of partition 1…:f
“);
printf(”
Erase 64 byte page of partition 0…:g
“);
printf(”
Erase 64 byte page of partition 1…:h
“);
printf(”
Checksum of partition 0…:i
“);
printf(”
Checksum of partition 1…:j
“);
printf(”
Write PWM value (hex)…:stuck_out_tongue:
“);
printf(”

End Program…:q

");

  Mem_cmd=getchar();
  switch(Mem_cmd)
  {
  	case 'a':
     {
     	printf("

MAX1464 memory partition 0

“);
while (compt<0x1000)
{
printf(”
Page:%d Address:0x%04x 0x%04x

",(compt/64),(compt),(compt+63));
while (compt2<0x40)
{
rawdata=MemReadWrite(0x00,Lbyte,Hbyte,0x00,chip_select);
printf("0x%02x “, rawdata);
compt2++;
compt++;
Lbyte=(compt&0x00ff);
Hbyte=(compt>>8);
rawdata=0x00;
}
compt2=0x00;
}
break;
}
case ‘c’:
{
printf(”
MAX1464 memory partition 1

“);
while (compt<0x80)
{
printf(”
Page:%d Address:0x%04x 0x%04x

",(compt/64),(compt),(compt+63));
while (compt2<0x40)
{
rawdata=MemReadWrite(0x02,Lbyte,Hbyte,0x00,chip_select);
printf("0x%02x “, rawdata);
compt2++;
compt++;
Lbyte=(compt&0x00ff);
Hbyte=(compt>>8);
rawdata=0x00;
}
compt2=0x00;
}
break;
}
case ‘b’:
{
addrdatainput(0x0000,0x1000,0x01,chip_select);
break;
}
case ‘d’:
{
addrdatainput(0x0000,0x008,0x03,chip_select);
break;
}
case ‘e’:
{
MemReadWrite(0x04,0x00,0x00,0x00,chip_select);
break;
}
case ‘f’:
{
MemReadWrite(0x05,0x00,0x00,0x00,chip_select);
break;
}
case ‘g’:
{
page_to_be_erase(0x06,chip_select);
break;
}
case ‘h’:
{
page_to_be_erase(0x07,chip_select);
break;
}
case ‘i’:
{
checksum=0x00000000;
add_cmpt=0x0000;
while(add_cmpt<0x01000)
{
Lbyte=(0x00ff&add_cmpt);
add_cmpt=(add_cmpt>>8);
Hbyte=(0x00ff%add_cmpt);
rawdata=MemReadWrite(0x00,Lbyte,Hbyte,0x00,chip_select);
buf=(rawdata&0x000000ff);
checksum=(checksum+buf);
printf(”

Checksum of partition 0 is: 0x%08lx",checksum);
add_cmpt=(0x00ff&Hbyte);
add_cmpt=(add_cmpt<<8);
add_cmpt=(add_cmpt|Lbyte);
add_cmpt++;
printf(" Address: 0x%04x",add_cmpt);
}
break;
}
case ‘j’:
{
checksum=0x00000000;
add_cmpt=0x0000;
while(add_cmpt<0x0080)
{
Lbyte=(0x00ff&add_cmpt);
add_cmpt=(add_cmpt>>8);
Hbyte=(0x00ff%add_cmpt);
rawdata=MemReadWrite(0x02,Lbyte,Hbyte,0x00,chip_select);
buf=(rawdata&0x000000ff);
checksum=(checksum+buf);
printf("

Checksum of partition 1 is: 0x%08lx",checksum);
add_cmpt=(0x00ff&Hbyte);
add_cmpt=(add_cmpt<<8);
add_cmpt=(add_cmpt|Lbyte);
add_cmpt++;
printf(" Address: 0x%04x",add_cmpt);
}
break;
}
case ‘p’:
{
printf("
Valeur hexadecimale…:);
gets(Valeur);
rawdata=str2hex(Valeur);
ChanPwmWrite(chip_select, rawdata);
break;
}
default:
{
if(Mem_cmd==‘q’)printf("

End of Program

“);
else printf(”

Wrong parameter

");
}
}
}
exit;

}

Perhaps this is your problem? Fifth function definition from the top.

unsigned char addrhb,unsigned char dbyte, unsigned char CS);

This is not the problem. It is only the text wrap of the arguments of the function ‘MemReadWrite’. If that was the problem, I hope that Dynamic C would be clever enough to point the error on the right line.

Meanwhile, I tried to copy the code in a new text sheet and recomplie: No change, the same error.

Some of the characters in your post got converted into smileys, but this line looks wrong:
>>> printf("
Valeur hexadecimale…;

The end quote is missing.

Jim

You’re right! That was the problem.

Strangely, I’m surprise that Dynamic C wasn’t able to point the error on the right line…:frowning:

Now, I’ll change the syntax color of sting to give more contrast with the other text.

Thanks for your help.

Dynamic C’s compiler has let me down plenty of times in this respect. Do not count on it to find you errors for you always!!!