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

Same compiler(3.219), same code, different XP version, Error

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







Same compiler(3.219), same code, different XP version, Error
PostPosted: Sat Nov 08, 2008 2:01 pm     Reply with quote

I have same compiler (3.219) installed on three different PC:s. Oldest is working fine with my all my code. My other PC:s are with XP sp3 and other is vista business. I have working code with #int_rda in it. Now I tried to compile same code with new PC:s and get error "Invalid Pre-Processor directive" This is not only problem, some codes compile without errors.
Sample code, gives same error.
Code:
#include <16F628.h>
#byte PORTA = 5
#byte PORTB = 6

#use delay(clock=4000000, RESTART_WDT)
#fuses WDT, XT, PUT, NOLVP, PROTECT, NOBROWNOUT
#use rs232(baud=4800, xmit=PIN_B2, rcv=PIN_B1)


#define BUFFER_SIZE 64
byte buffer[BUFFER_SIZE];
byte next_in = 0;
byte next_out = 0;


#int_rda
void serial_isr() {
   int t;

   buffer[next_in]=getc();
   t=next_in;
   next_in=(next_in+1) % BUFFER_SIZE;
   if(next_in==next_out)
     next_in=t;           // Buffer full !!
}

#define bkbhit (next_in!=next_out)

byte bgetc() {
   byte c;

   while(!bkbhit);
   c=buffer[next_out];
   next_out=(next_out+1) % BUFFER_SIZE;
   return(c);
}

void clear_buffer (void)
{
int b=0;
while(bkbhit)
b=bgetc();
}



void main (void)
{
char in;
enable_interrupts(global);
enable_interrupts(int_rda);
set_tris_a(0b00000010);
set_tris_b(0b11110011);
delay_cycles( 10);
setup_comparator(NC_NC_NC_NC);
setup_counters (RTCC_INTERNAL, WDT_2304MS);

while(1)
{
clear_buffer();
printf("at+cpas\r\n");
while(bgetc()!=':');
in=bgetc();
delay_ms(1000);
}
} //main end
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Nov 08, 2008 5:37 pm     Reply with quote

Your example code compiles fine on my computer in v3.226. I get a warning " Line 65(1,1): Condition always TRUE" but this is normal for the 'while(1)' loop.
What is the exact error message you get and for which line in the code?

The only thing I can think of is that you maybe changed the 16F628.h file on the old computer and that you forgot to copy this change to the new computer? This is exactly the reason why you should never modify the compiler supplied header files.
kari
Guest







PostPosted: Sun Nov 09, 2008 12:13 am     Reply with quote

Error message is "Invalid Pre-Processor directive" and pointing to line "#int_rda". I am really confused! I haven't modified 16f628.hex file.
Ttelmah
Guest







PostPosted: Sun Nov 09, 2008 3:22 am     Reply with quote

First thing, is that CCS, often points at a line somewhere 'after' where the actual fault occurs.
I'd be looking at several things:
First, though you have not modified the processor include file, verify that the ones in all systems are the same, and that the compiler is setup to look into the correct location for these in each case.
Then, verify that the 'devices.dat' file is the same for all systems.
You don't say whether this is a 'W' version compiler, but if so, chipedit could have been used to change this file.
It is what you would 'expect' to see, if the compiler was trying to load a device file without the INT_RB definition present. Also check permissions on the files. Something 'silly', like not having write permissions in the compile directory, can give this sort of error.

Best Wishes
Kari
Guest







PostPosted: Sun Nov 09, 2008 3:26 pm     Reply with quote

I found that devices.dat has changed. Working file is 303k and dated 14.2.2005. Corrupted devices.dat was 247k 17.10.2003. I reinstall compiler and everything worked fine. Then I start looking what may have broken devices.dat file. I installed ICDS-40 program version 2.24 - yes it's old Smile and voila, devices.dat was corrupted. Now I have ICDS program ver. 2.99 and everything is working fine.

Thank you for help, regards,

Kari Leino, Finland
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