Hi:
I have this macro in my project:
#define Col1_GetVal() ( \
(bool)((getReg8(PTAD) & 0x10)) /* Return port data */ \
)
I have severals Colx_GetVal macros and i need use a array of pointers to them:
ptr[0]= &Col1_GetVal;
ptr[1]= &Col2_GetVal;
and so....
Anybody can give me some tip how i can o it?
Best Regards.
Mauricio.
Solved! Go to Solution.
macros don't have address, thus pointers can't point to macros.
But you may convert macros into functions like this
bool Col1_GetVal(void)
{
(bool)((getReg8(PTAD) & 0x10)) /* Return port data */ \
}
Define array of pointers :
char (*array[3])(void);
array[2] = &foo; // assign
array[2](); // call foo
To call PE macros proceed like above, but define your own functions and make them calling PE macros.
macros don't have address, thus pointers can't point to macros.
But you may convert macros into functions like this
bool Col1_GetVal(void)
{
(bool)((getReg8(PTAD) & 0x10)) /* Return port data */ \
}
Define array of pointers :
char (*array[3])(void);
array[2] = &foo; // assign
array[2](); // call foo
To call PE macros proceed like above, but define your own functions and make them calling PE macros.