This is because of the process order of GCB- ifdefs are processed first then are resolved then processing continues. (I stand to be totally correctly by Hugh). :-)
I would change to a sub with parameters - macros will also create more inline code, again recommend using subs unless speed is your real issue. change the ifdef to if then.
Evan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was trying the macro route because I was trying to generate a variable name dynamically and then assign a value to it according to the pin input.
I am thinking about the most efficient way to create a pps library that is missing today.
PPSMapIn(pin,fn) would assign function fn (CCP1,CCP2,RX,...) to the pin given as parameter (RA0,RA1,...)
Likewise for PPSMapOut
Last edit: Jacques Nilo 2015-06-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all
I am wondering why the following test program returns 5 and not 6...
Any suggestion/workaround are welcome !
Jacques
Last edit: Jacques Nilo 2015-06-06
This is because of the process order of GCB- ifdefs are processed first then are resolved then processing continues. (I stand to be totally correctly by Hugh). :-)
I would change to a sub with parameters - macros will also create more inline code, again recommend using subs unless speed is your real issue. change the ifdef to if then.
Evan
I was trying the macro route because I was trying to generate a variable name dynamically and then assign a value to it according to the pin input.
I am thinking about the most efficient way to create a pps library that is missing today.
PPSMapIn(pin,fn) would assign function fn (CCP1,CCP2,RX,...) to the pin given as parameter (RA0,RA1,...)
Likewise for PPSMapOut
Last edit: Jacques Nilo 2015-06-06