May 2020
Intermediate to advanced
496 pages
13h 54m
English
One way of achieving minimal instructions and responsibility in the ISR is to do the smallest amount of work possible inside the ISR and then set a flag that is checked by code running in the super loop. This way, the interrupt can be serviced as soon as possible, without the entire system being dedicated to waiting on the event. In the following diagram, notice how the interrupt is being generated multiple times before finally being dealt with by func3.
Depending on what exactly that interrupt is trying to achieve, it will typically take a value from the associated peripheral and push it into an array (or take a value from an array and feed it to the peripheral registers). In the case of our external ADC, the ...