Hi,
I'm using the KL03. I have two independent parallel tasks.
One task changes from one state to another periodically. This is the simplified code:
case 1:
nState = 2;
uTaskerMonoTimer('B', (DELAY_LIMIT) (2 * SEC), UTASKER_ACTIVATE);
break;
case 2:
nState = 1;
uTaskerMonoTimer('B', (DELAY_LIMIT) (3 * SEC), UTASKER_ACTIVATE);
break;
The other task configures a port interrupt (on a GPIO pin) and its handling function fn_rx_interrupt_handler is called whenever the interrupt is triggered externally on that pin.
static void fn_rx_interrupt_handler(void) {
fn_b();
}
All this works.
Now, I want that fn_b() is executed ONLY if nSTate==1, so I simply do:
static void fn_rx_interrupt_handler(void) {
if (nState == 1) {
fn_b();
}
}
But this doesn't work. The task ignores the interrupt. Even if I try to put the control of nState in fn_b, it still doesn't work. It is as if that if statement in the interrupt disables it
Any idea why and what I can do?