??? 08/15/05 11:45 Read: times |
#99407 - optimizing Responding to: ???'s previous message |
Russell,
1. you don't need to reconstruct the stack, it is initialized (it MUST be initialized - there may be any contect in it) upon the restart, so you can drop the two pops (normally I don't suppose stack shortage anywhere; save in an interrupt which does not need to save any context). 2. checking the button in each and every loop that might take a bit longer all over the application - and remembering to put it into each new piece you add later - can sometimes be "bruter" force. Of course you might argue that a program SHOULD consist of a single loop - in the same way people SHOULD eat healthy food and SHOULD do excercises and SHOULD NOT drink and smoke :-) 3. it is not impossible to put the chip into a state 100% same as at reset - it's just a piece of silicon, it does what is told to do 4. everything you said on safety etc. still 100% holds Jan Waclawek |