|
|
View previous topic :: View next topic |
Author |
Message |
assaad
Joined: 09 Dec 2009 Posts: 37
|
C library code |
Posted: Tue Mar 12, 2013 3:02 am |
|
|
Hello all
Is it possible to create a C library code, so we can use the functions in it, but we cant let someone else see the source of the code.
Is that possible with ccs ?
Regards |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Tue Mar 12, 2013 3:58 am |
|
|
Yes. This is what linking is about.
You'd generate a set of routines, compile these to a linkable OBJ (.o) module, with the functions 'exported', then in you main program define these routines as 'external' and import these and link the module. The main code only has to know that the functions exist, what they are called, and what their 'calling convention' is, not the details of the code.
It is not (at heart), how CCS is normally used, but it does now support this.
How to do it, depends on whether you are using the IDE, or command line. On the command line, the link has to be added to the commands you use. On the IDE, the 'multiple compilation units' tick box in the Project Options, and 'Link separately' allows this.
Look at 'linker overview' in the manual. There is also an example 'mcu.zip', included in the examples directory.
Best Wishes |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Tue Mar 12, 2013 5:46 am |
|
|
also...
be sure to 'protect' the PIC code from being read by the other person.
It ain't rocket science to 'reverse engineer' the program from within the PIC.
hth
jay |
|
|
|
|
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
|