|
|
View previous topic :: View next topic |
Author |
Message |
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
can we overload a compiler function? |
Posted: Mon Oct 23, 2006 11:52 pm |
|
|
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
|
|
Posted: Tue Oct 24, 2006 4:17 am |
|
|
#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 |
|
|
|
|
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
|