What is wrong is this C-code (error message: missing right par , missing semicol.) at line FCV_ABD_FLAG= (baudcon,ABDEN)
while (!(FCV_ABD_FLAG == 0))
{
//Stop on overflow baud rate counting
//C Code:
if (baudcon,ABDOVF) // ABDOVF is overflow bit
{
FCV_COUNTH=FCV_COUNTH+1 // increase byte 3 with 1
}
FCV_ABD_FLAG= (baudcon,ABDEN); //save satus enable bit (will be auto cleared)
}
Kind regards
Jan Lichtenbelt
C-code error
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: C-code error
Though 'baudcon,ABDOVF' is technically C code, it probably wont be read OK by the BoostC compiler.
Did you mean: baudcon.ABDOVF (dot instead of comma)?
Also there is a missing semi-colon after:
FCV_COUNTH=FCV_COUNTH+1
Cheers,
Jonny
Did you mean: baudcon.ABDOVF (dot instead of comma)?
Also there is a missing semi-colon after:
FCV_COUNTH=FCV_COUNTH+1
Cheers,
Jonny
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: C-code error
Hi Jonny,
Thanks for your help.
What I really want is a loop which wait until the ABDEN bit in the BAUDCON register gets 0 (disabled). Sometime like:
while (baudcon,ABDEN)
{
}
But is I put that in a C-box, it is show in the c file, but it never gets in the assembler version (.asm file)
What to do?
Kind regrads
Jan
Remark: BAUDCON Baud rate control register is described e.g. in the PIC16F1939 datasheet p. 302.
Thanks for your help.
What I really want is a loop which wait until the ABDEN bit in the BAUDCON register gets 0 (disabled). Sometime like:
while (baudcon,ABDEN)
{
}
But is I put that in a C-box, it is show in the c file, but it never gets in the assembler version (.asm file)
What to do?
Kind regrads
Jan
Remark: BAUDCON Baud rate control register is described e.g. in the PIC16F1939 datasheet p. 302.
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: C-code error
Hi Jan.
If it is in the C code but not in the assembler it is probably being optimised out.
I haven't done much with the BoostC compiler, but the ',' (comma) operator is usually used in C to sequence operations.
This means that the code:
while (baudcon,ABDEN)
{
}
Will be reduced to:
while (ABDEN)
{
}
If this never makes the ASM, I'm guessing ABDEN is defined as bit 0, so this becomes:
while (0)
{
}
Which will be optimised out.
Try with a '.' (structure) operator instead and see if this works:
while (baudcon.ABDEN)
{
}
Cheers,
Jonny
If it is in the C code but not in the assembler it is probably being optimised out.
I haven't done much with the BoostC compiler, but the ',' (comma) operator is usually used in C to sequence operations.
This means that the code:
while (baudcon,ABDEN)
{
}
Will be reduced to:
while (ABDEN)
{
}
If this never makes the ASM, I'm guessing ABDEN is defined as bit 0, so this becomes:
while (0)
{
}
Which will be optimised out.
Try with a '.' (structure) operator instead and see if this works:
while (baudcon.ABDEN)
{
}
Cheers,
Jonny
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: C-code error
Dear Jonny
It should indeed be a point instead of a comma:
while (baudcon.ABDEN)
{
}
The assembler file looks fine now!
Thanks a lot!
With kind regards
Jan Lichtenbelt
It should indeed be a point instead of a comma:
while (baudcon.ABDEN)
{
}
The assembler file looks fine now!
Thanks a lot!
With kind regards
Jan Lichtenbelt