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

Can a prototype be used on a #org'd function

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



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

Can a prototype be used on a #org'd function
PostPosted: Fri Dec 16, 2005 9:24 am     Reply with quote

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();
}


treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Fri Dec 16, 2005 9:45 am     Reply with quote

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();
}


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