![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
Can a prototype be used on a #org'd function |
Posted: Fri Dec 16, 2005 9:24 am |
|
|
I am trying to move my bootloader, # org'd function to the botom of the program listing. When I do and put in the required prototype, the compiler complains about function different from def.
Above main without prototype works...
Below main with prototype fails....
???prototype wrong??
Code: | #include <18F452.H>
#CASE
#USE DELAY(CLOCK=40000000)
#FUSES H4,NOWDT,NOPROTECT,NOLVP
#DEFINE VER_MAJOR 2
#DEFINE VER_MINOR 01
#USE RS232(BAUD=19200,XMIT=PIN_C0,INVERT,STREAM=DEBUG,DISABLE_INTS) // STDERR(same as DEBUG)
#USE RS232(BAUD=19200,ENABLE=PIN_C5,XMIT=PIN_C6,RCV=PIN_C7,STREAM=RS485)
//==========prototypes===========
void PrgmPIC(void);
void main(void)
{
int16 cnt;
int32 address;
char buf[256];
fprintf(DEBUG,"Start\n\r");
while(1)
{
}
}
//===================== PrgmPIC =========================
#org 0x7A00, 0x7FC0
void PrgmPIC(void){
int32 address=0,size,offset;
fprintf(DEBUG,"Done\n\r");
reset_cpu();
}
|
|
|
![](templates/subSilver/images/spacer.gif) |
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Fri Dec 16, 2005 9:45 am |
|
|
Got it. Need a #seperate infront of prototype
Code: | #include <18F452.H>
#CASE
#USE DELAY(CLOCK=40000000)
#FUSES H4,NOWDT,NOPROTECT,NOLVP
#DEFINE VER_MAJOR 2
#DEFINE VER_MINOR 01
#USE RS232(BAUD=19200,XMIT=PIN_C0,INVERT,STREAM=DEBUG,DISABLE_INTS) // STDERR(same as DEBUG)
#USE RS232(BAUD=19200,ENABLE=PIN_C5,XMIT=PIN_C6,RCV=PIN_C7,STREAM=RS485)
//==========prototypes===========
#separate
void PrgmPIC(void);
void main(void)
{
int16 cnt;
int32 address;
char buf[256];
fprintf(DEBUG,"Start\n\r");
while(1)
{
}
}
//===================== PrgmPIC =========================
#org 0x7A00, 0x7FC0
void PrgmPIC(void){
int32 address=0,size,offset;
fprintf(DEBUG,"Done\n\r");
reset_cpu();
}
|
|
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|