| ▲ | echoangle 10 hours ago | |||||||||||||||||||||||||||||||
What if my CPU doesn't have that? I don't think Atmel Microcontrollers do for example. | ||||||||||||||||||||||||||||||||
| ▲ | bluGill 9 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||
Better CPU selection. Embedded almost always have power requirements and you need to put your CPU into a low power mode not a loop which is running fast. You can also design your hardware such that you can turn the power off completely in these cases (or perhaps reboot). Now that I think of it, a different project (I worked just down the aisle, but I wasn't on it) solved a lot customer complaints by turning all the "while(1);" loops into blink an error code - which since it does IO is defined behavior. Which probably is the correct answer to your question - don't just spin doing nothing, spin in such a way that the user has a clue why nothing is working (and in turn you can find out and perhaps fix real world bugs) | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ▲ | AMDmi3 8 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||
AVRs have SLEEP instruction. | ||||||||||||||||||||||||||||||||