4 ms·
You're not entirely wrong, and thanks for pointing this out, but polling is also frequently used to mean "busy-wait loops" - you can look for it if you doubt me
by buescher 3y ago
You're not entirely wrong, and thanks for pointing this out, but polling is also frequently used to mean "busy-wait loops" - you can look for it if you doubt me. I didn't really want to get into that conversation.
The other thing that polling implies is that there will not always be data present when you poll (think of a UART driver), and you might block as long as there is, and you may or may not be polling at a deterministic rate. Sampling unambiguously implies that a sample is always present and handled. It does not preclude any use of interrupts - you can sample with a timer interrupt or handle a sample with an A/D interrupt.
Many embedded programmers of a certain age have a nearly fixed mental model of a microcontroller as a sort of headless VIC-20 and a certain horror at sampling techniques that derives from enduring crummy polling peripheral drivers/handlers from the early days of personal computing.