Hi, I have several functions called in T0 isr. The outline of call tree like this:
void T0_isr() interrupt 1 { getkey(); } void getkey() { char c; c = filterGetKeyCode(); } char filterGetKeyCode() { char c; c = getKeyCode(); return c; } char getKeyCode() { char c; char cd; // c be assigned somehow cd = encodeFlex(c); c = decode(cd); return c; } char encodeFlex(char c) { return encode(c); } char encode(char); char decode(char);
When checking the call map, I eventually found where the multiply calls occurred. There are two callers to _getkey, a function implemented in a project-specific way to override the library function with the same name in stdio.lib. I explicitly called _getkey in T0_isr, and again I implicitly called _getkey in scrollDigit since it calls sscanf, which in turn calls getchar, which then call _getkey. All related call branches are listed as follows.
?PR?GETKEYCODE?KEYBOARD_P +--> ?PR?_DECODE38?FUNC +--> ?PR?_ENCODE83FLEX?FUNC ?PR?_ENCODE83FLEX?FUNC +--> ?PR?_ENCODE83?FUNC ?PR?FILTERKEYCODE?KEYBOARD_P +--> ?PR?GETKEYCODE?KEYBOARD_P ?PR?_GETKEY?KEYBOARD_P +--> ?PR?FILTERKEYCODE?KEYBOARD_P +--> ?PR?_TOASCII?KEYBOARD_P +--> ?PR?_LOADKEYQUEUE?KEYBOARD_P ?PR?T0_ISR?T0_ISR +--> ?PR?_GETKEY?KEYBOARD_P ?PR?_SCROLLDIGIT?GUI +--> ?CO?GUI +--> ?PR?PRINTF?PRINTF +--> ?PR?SCANF?SCANF +--> ?PR?_TEXTOUT?GUI ?PR?SCANF?SCANF +--> ?PR?GETCHAR?UNGETCHAR +--> ?PR?_ISSPACE?ISSPACE +--> ?PR?GETCHAR?GETCHAR +--> ?PR??C?ATOF??C?ATOF ?PR?GETCHAR?GETCHAR +--> ?PR?_GETKEY?KEYBOARD_P +--> ?PR?PUTCHAR?PUTCHAR