July 2022
Intermediate to advanced
304 pages
7h 6m
English
The two main methods for handling I/O are polling, which repeatedly asks the device whether it has any data ready, and interrupts, which are when the device interrupts normal workflow to tell you it’s ready. This chapter describes the difference between polling and interrupts as well as explains how interrupts work so you can use them to write a string to the serial port more efficiently (yes, “Hello World” again).
Let’s consider how polling and interrupts would work in the case of the telephone. With polling, the ringer is turned off, and you must check the phone every 10 seconds to see whether a call ...
Read now
Unlock full access