We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Dear All,
When I am compling the c program below i am getting the error
"""error C211: call not to a function"""
Can anyone help me out with this error ?
/**************C FIle*************/ #include "abc.h"
extern unsigned char func_arry_pntr; extern unsigned int xdata *funcArr[32];
void timer1_routine(void) interrupt T1_INT using 3 { static unsigned char intr_counter;
++intr_counter; if(intr_counter == 0x0A) { intr_counter = 0x00; (*funcArr[func_arry)pntr])();
if(func_arry_pntr < MAX_ARRAY_SIZE) { ++func_arry_pntr; } else { func_arry_pntr = 0x00; }
}
/*********** array define *******/
xdata unsigned int (*funcArr[32]) = {&func1, &func2, &func3, &func4, NULL, NULL, NULL, NULL};
I don't know what you thought with:
extern unsigned char func_arry_pntr;
A type declaration of a function pointer looks like:
typedef return_type (*type_name)(parameters);
"func_arry_pntr" is defining the index of an array funcArr[] of function pointers.
I am incrementing the array index when intr_counter equals to 0x0A, so that program run next function.
so all its doing is running function func1, func2 etc whenever i am incrementing the array index func_arry_pntr
Did you read my post about a type declaration of a function pointer?
extern unsigned int xdata *funcArr[32];
This is an array of 32 pointers to unsigned int. Not an array of 32 function pointers.
Thanks Mark for your help. I corrected the declaration of function pointer using typedef and its compling the program without any errors :)
thanks again