??? 05/13/08 12:22 Read: times |
#154728 - You're doing pretty good then. Responding to: ???'s previous message |
This is what you get when you throw a windows app programmer at embedded programming.
Well, we've seen worse ;), like trying to make the poor '51 wrestle with dynamic memory allocation or function pointers. Or people complaining that their C compiler doesn't understand C++. Or people wondering why their program will break any timing constraints when they're trying to do heavy floating-point math inside an ISR. Many of Russ' tips are not specific to embedded programming, though. Using constants or #define's instead of magic numbers applies pretty much everywhere. The same goes for avoiding global variables unless there are very specific reasons for using them ("programmer convenience" doesn't count here). As Russ said, interrupt service routines should be kept as short as possible, and preferably not call any other functions, since you will have to deal with reentrancy issues in that case. Anything you do in an ISR will have to be checked for common problems that arise in multitasked- and real-time systems (race conditions, reentrancy issues, atomicity issues, etc), which adds another boatload of possible problems to the number that can pop up in a non-multitasked program. |
Topic | Author | Date |
Struct member losing value | 01/01/70 00:00 | |
Please post your code | 01/01/70 00:00 | |
Posted here (along with file descriptions): | 01/01/70 00:00 | |
the can of worms | 01/01/70 00:00 | |
Your program needs to be restructured | 01/01/70 00:00 | |
Can't mod this one up enough. | 01/01/70 00:00 | |
Thanks for the tips | 01/01/70 00:00 | |
You're doing pretty good then. | 01/01/70 00:00 | |
I think that it can be said in a simple way | 01/01/70 00:00 | |
Sorry but.. | 01/01/70 00:00 | |
Agreed | 01/01/70 00:00 | |
the phrase was | 01/01/70 00:00 | |
I agree | 01/01/70 00:00 | |
Don't ignore rules | 01/01/70 00:00 | |
What is "short" in an ISR...? | 01/01/70 00:00 | |
Two Program | 01/01/70 00:00 | |
breaking switch/case![]() | 01/01/70 00:00 | |
Do you understand why? | 01/01/70 00:00 | |
make it a FAQ, please... | 01/01/70 00:00 |