??? 07/28/04 21:50 Read: times |
#75055 - Use a switch statement! Responding to: ???'s previous message |
Keil Ruben said:
Is there a limit of if statements that you can have within an interrupt function? There is no specific limit per se but, as Erik says, if your ISR is so long that it hasn't finished before the next interrupt comes along - then you're obviously in trouble. If your code is taking too long in this ISR, it will also be blocking other interrupts, and leaving less time for your "main" loop to do any work. The trouble with the way you've written it is that it may have to fail up to 12 tests before deciding what (if anything) to do! Unless you have a specific need for this priority order, you should re-write the code using a 'switch' statement (which the compiler may well end up implementing as a lookup table - as Oleg suggested) |
Topic | Author | Date |
LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: LCD Help! | 01/01/70 00:00 | |
RE: Lookup table![]() | 01/01/70 00:00 | |
Use a switch statement! | 01/01/70 00:00 |