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 CCS Technical Support

can we overload a compiler function?

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



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

can we overload a compiler function?
PostPosted: Mon Oct 23, 2006 11:52 pm     Reply with quote

I am using a PIC18F8722 with PCWH 3.249

This PIC has a problem with the SPI (lots of problems) and I need to implement a work around as per the errata. My code base supports multiple different PIC families so I need a mechanism to address just the 8722 and variants.

What I want to do is be able to substitute the CCS spi_read() function with my own. I do not want to use a different function name. The compiler seems happy to accept it but will not use it. Can internal functions be overloaded in this version?

Failing that, can I disable the internal function?
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Ttelmah
Guest







PostPosted: Tue Oct 24, 2006 4:17 am     Reply with quote

#define, can be used, since the macro expansion, takes place before the main compiler pass. So:

#define spi_read(x) my_spi_func(x)

Will replace all internal calls to 'spi_read', with calls to your 'my_spi_func' function.

Best Wishes
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