2018-09-02 01:12 AM
Hello everyone, maybe it's a stupid question but in the interrupt handling function I can't rewrite a variable. I'm sure that the interrupt is triggered and assigns a value to rx_counter, read_msg is executed in a loop, but when the value of a variable is checked, it is always equal zero.
2018-09-02 07:59 AM
Why are you using a screen capture and not code snippet.
Have you tried making your variable volatile like this: volatile uint8_t nbr;
volatile uint8_t nbr;
2018-09-02 10:55 AM
> maybe it's a stupid question
Maybe ...
Do you see that rx1_counter is defined locally in the IRQ handler, and used in function read_msg?
This means that another variable named rx1_counter is defined outside, and this is what read_msg() uses. IRQhandler modifies its local variable,
-- pa