Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone,
I have a question, i am using c language to program PIC micro controller, but i have a problem:
i am using multiple compilation programming, so that each code library is composed of header file (.h) and source file (.c), i made an array of functions using typedef
typedef void (*out)(int8 weight);
void OUT_A(int8 weight){output_A(weight);}
void OUT_B(int8 weight){output_B(weight);}
void OUT_C(int8 weight){output_C(weight);}
void OUT_D(int8 weight){output_D(weight);}
void OUT_E(int8 weight){output_E(weight);}
static out output_port[5+1] = {OUT_A, OUT_B, OUT_C, OUT_D, OUT_E};


the function inside the array is not responding, but if i use the same array in a single compilation unit project, it is working fine, i don't know what to do, is there some sort of declaration and/or definition for this issue.

Thanks in advance,
z3ngew
Posted
Comments
Sergey Alexandrovich Kryukov 2-Aug-13 15:27pm    
The function is not "responded" or not. You just call it or not. Where are your calls?
—SA
z3ngew 2-Aug-13 15:34pm    
(*output_port[0])(15); //this is how i call it

z3ngew
Sergey Alexandrovich Kryukov 2-Aug-13 15:54pm    
Okay, call it and see what happened. Why do you think something is not "responded". Use the debugger, after all.
—SA
z3ngew 2-Aug-13 15:53pm    
I will try to make a new array of function that print string on an lcd in order debug what's wrong.
Thanks,
z3ngew
CPallini 2-Aug-13 16:50pm    
Could you please elaborate? Where are the functions declared? Where are they defined? Where are they called? How?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900