??? 07/02/04 23:58 Read: times |
#73557 - When is polling preferable? Responding to: ???'s previous message |
Joseph Hebert said:
Can one think of a time, a specific application or circumstance, where such an approach [polling] would be favored or worthwhile? Well, polling is marginally simpler than using interrupts (eg, you don't need buffers & flags between your ISR and main code). One application where polling could work well is when you are the master in a protocol where the master sends most of the data, and only ever needs to receive single-character responses from the slave(s). Even then, I'm not sure that polling would be the favoured approach... Generally, I think I agree with Erik: the main reason for avoiding interrupts is because they're seen as "difficult", and people use polling as the "easy" way out, rather than sitting down and making the effort to get interrupts properly sussed! |