View previous topic :: View next topic |
Author |
Message |
Jody
Joined: 08 Sep 2006 Posts: 182
|
Expecting a close paren ... why and what?? |
Posted: Fri Sep 23, 2016 4:31 am |
|
|
Oke get that error but why... made a small example:
At the first output_low(RS) I get the error..
If I replace it with: output_low(PIN_B0); it is fine... but I want the RS in it..
Compiler version: 5.025
main.c:
Code: |
#include <main.h>
void CheckBusy(void)
{
int1 busy_f;
output_d(0xff);
output_low(RS); [b] <== THE ERROR[/b]
output_high(RW);
do
{
output_high(E);
busy_f = input(lcd_busy);
output_low(E);
}while(busy_f);
}
void main()
{
while(true)
{
}
}
|
and main.h:
Code: |
#include <18F8722.h>
#device ADC=16
#define busy PIN_D7;
#define RS PIN_B0;
#define RW PIN_B1;
#define E PIN_B2;
#define CS1 PIN_B3;
#define CS2 PIN_B4;
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES BBSIZ1K //1K words Boot Block size
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#use delay(clock=10000000,crystal=10MHz)
|
What is wrong??? |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Fri Sep 23, 2016 5:22 am |
|
|
Your problem is back at the defines.
First, move your #defines AFTER the FUSES. Fuses should always come right after the #device lines.
Second, remove the semi-colon at the end of each #define (see the manual) _________________ Google and Forum Search are some of your best tools!!!! |
|
|
Jody
Joined: 08 Sep 2006 Posts: 182
|
|
Posted: Fri Sep 23, 2016 5:34 am |
|
|
yep that did it!!
semicolon remove was the trick thanks!!! :oops: |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Fri Sep 23, 2016 7:08 am |
|
|
It's also a 'classic' CCS problem. Their syntax 'parser', will keep ploughing on and often fail several lines after the 'real error'. You can remove sections, or change the order that things are declared to 'narrow down' where the problem really is...
In this case though the first real error is in the line it displays on.
With the semi-colons there the error line gets translated to:
output_low(PIN_B0;);
Which has the first ';' being met before the bracket, so it complains that it needs a closing bracket. |
|
|
|