CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Expecting a close paren ... why and what??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jody



Joined: 08 Sep 2006
Posts: 182

View user's profile Send private message Send e-mail

Expecting a close paren ... why and what??
PostPosted: Fri Sep 23, 2016 4:31 am     Reply with quote

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: 1914
Location: Norman, OK

View user's profile Send private message

PostPosted: Fri Sep 23, 2016 5:22 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Sep 23, 2016 5:34 am     Reply with quote

yep that did it!!
semicolon remove was the trick thanks!!! :oops:
Ttelmah



Joined: 11 Mar 2010
Posts: 19260

View user's profile Send private message

PostPosted: Fri Sep 23, 2016 7:08 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group