Thanks for answer Bob,
unfortunately I dont have the atomic.h module...
Anyway, no problem! I solved in this way:
First of all, my necessity was to be sure that calling a function from other one, wont enable by mistake the interrupts, while the calling function "thinks" that interrupts are still disabled. Example in pseudo-code:
void F1(void) {
....
DISABLE_INTERRUPT
....
F2();
....
....
ENABLE_INTERRUPT
}
void F2(void) {
...
DISABLE_INTERRUPT
....
.....
.....
ENABLE_INTERRUPT
}
As u simply can understand, the instructions after the F2 call, would be with interrupt enabled! That's why I would have need a way to check interrupts state.
Luckly, the KSDK (1.2.0) provided for MKL17Z and KDS 3.0.0, provide 2 primitives OSA_EnterCritical and OSA_ExitCritical (from fsl_os_abstraction component), that manage this automatically, with counters that keep in mind how many time interrupts disable request is called. I didnt notice this before create this discussion.
So u can call nested disable request without problem.
Hope this can help someone :-)
Thanks againg Bob.
Sandro