Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5175

General • Re: New to pico, having trouble with hardware interrupts in C

$
0
0
I guess there are many errors.

But to name one that directly stands out:

Code:

bool interrupt_flag = false;
must be

Code:

volatile bool interrupt_flag = false;
The interrupt handler is changing the variable, it must be volatile.

Statistics: Posted by terencehill — Tue Dec 26, 2023 11:20 pm



Viewing all articles
Browse latest Browse all 5175

Trending Articles