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

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.
Tried it and it worked perfectly. Thank you so much!

Statistics: Posted by machotaco789 — Wed Dec 27, 2023 12:13 am



Viewing all articles
Browse latest Browse all 5273

Trending Articles