in c51 i use function pointer : code void (*serial_tabel []) () ={ func_0, func_1, func_2, func_3,func_4 }; static void func_0 (){ strcpy(SPackData,"ngetit 0"); SendPack (); } static void func_1 (){ strcpy(SPackData,"ngetit 1"); SendPack (); } static void func_2 (){ strcpy(SPackData,"ngetit 2"); SendPack (); } static void func_3 (){ strcpy(SPackData,"ngetit 3"); SendPack (); } static void func_4 (){ data byte a,b,d; a = (byte) atoi(CMD_LOC[1]); b = (byte) atoi(CMD_LOC[2]); d = (byte) atoi(CMD_LOC[3]); SetBaseFrq(d); strcpy(SPackData,"i love you !"); SendPack (); } in func_4 () i get this warning : *** WARNING L13: RECURSIVE CALL TO SEGMENT SEGMENT: ?CO?SERIAL_CMD2 CALLER: ?PR?FUNC_4?SERIAL_CMD2 why ? what mean ? how reolve ?
It sounds like you have declared a table of function pointers in code space and some other variables in code space in the same file (SERIAL_CMD2.C). The error message
*** WARNING L13: RECURSIVE CALL TO SEGMENT SEGMENT: ?CO?SERIAL_CMD2 CALLER: ?PR?FUNC_4?SERIAL_CMD2
"There is an application note that covers everything you should know about function pointers in C51 because they are tricky." I've already told him that: http://www.8052.com/forum/read.phtml?id=32055&top=
I know. :-) Thanks, Jon
View all questions in Keil forum