|
|
View previous topic :: View next topic |
Author |
Message |
Kari Guest
|
Same compiler(3.219), same code, different XP version, Error |
Posted: Sat Nov 08, 2008 2:01 pm |
|
|
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
|
|
Posted: Sat Nov 08, 2008 5:37 pm |
|
|
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
|
|
Posted: Sun Nov 09, 2008 12:13 am |
|
|
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
|
|
Posted: Sun Nov 09, 2008 3:22 am |
|
|
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
|
|
Posted: Sun Nov 09, 2008 3:26 pm |
|
|
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 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 |
|
|
|
|
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
|