??? 03/16/09 06:36 Read: times |
#163476 - Can ISR functions be made 'static'? |
Hi,
I am using 8052 microcontroller in my project and having compiled code around 100K. I am using Keil microvision 3 compiler and using code banking with 2 code banks. My project is running fine, and I frequently run PC Lint and make the best use of it. Till now my project code is not having 'static' keyword usage. But, PC-Lint suggested Info 765 (- external 'Symbol' (Location) could be made static) for nearly 75 functions and some code memory arrays definitions in my project. I had observed the following related to Info 765 in my project: Lint is suggesting Info 765 for some functions(not all) and some code variable arrays definitions of banked modules only, and completely omitted the functions contained in the headers of the individual banked modules. I had added 'static' type to the suggested locations by PC-Lint. I had also made nearly 100 functions 'static' and some code memory variable arrays definitions by manual checking, and those are accepted by Keil C51 Complier as well as PC-Lint. Q:Can I rely upon the functions I made 'static' manually, which were not suggested by PC-Lint? or stick to the PC-Lint suggested static uses? Q:I had used 'static' for Interrupt service routine in my code and for the functions called from it. This is Timer 0 ISR and is running with 20 milliseconds ticks... static void storeCardDigits(void) using 1 { -- -- function code -- } static void extention_status(void) using 1 { -- -- function code -- } static void dtmfRead(void) using 1 { unsigned char i; for(i=0; i<8; i++) { -- -- function code -- } -- -- function code -- } static void updateTones(void) using 1 { unsigned char i; for(i=0; i<15; i++) { switch(tone_type) { -- -- 12-15 cases code -- } } -- -- function code -- } static void onTimerISR(void) interrupt 1 using 1 { extention_status(); ---- ---- storeCardDigits(); ---- ---- dtmfRead(); ---- ---- updateTones(); } Q: Can ISR function and its called functions be made 'static' type? What are the possible problems in doing so? PC-Lint and Keil C51 compiler are not generating any errors or warnings for this usage. Thanks in advance, |
Topic | Author | Date |
Can ISR functions be made 'static'? | 01/01/70 00:00 | |
What does 'static' mean? | 01/01/70 00:00 | |
Nothing magic with "static" | 01/01/70 00:00 | |
'static' local variables | 01/01/70 00:00 | |
Difference between normal auto and static auto.![]() | 01/01/70 00:00 |