I am using S32K144 micro controller . In this controller there are 16 interrupt level from 0 to 15.
In my application i am using two interrupt source and assigned priority 0 and 5 to both the interrupt source.
Now at some state in my code i am disabling the both interrupts ( i am using BASEPRI register to disable ).
So keeping in mind the above situation i have loaded BASEPRI= 0x00000000 to disable all interrupt having priorty level 0 and lower than 0 (means 5). But i am still getting interrupts,even i have disabled the interrupts.
Is this issue due to that i am putting "BASEPRI= 0x00000000"?
because Priority mask bits:
0x00 = no effect,as given in this manual
Could you please help me on this.
The BASEPRI register must be set to nonzero value in order to mask interrupts that have the same or lower interrupt priority. If you need to mask all interrupts including those with interrupt priority 0, then set PRIMASK bit.
__asm("cpsid i") // Disable interrupts __asm("cpsie i") // Enable interrupts
How do you set BASEPRI?
s32_core_cm4.h has macros for cpsie and cpsid, but nothing for BASEPRI register.
I am looking for something like this:
// code before critical section
__set_BASEPRI(6 << (8 - __NVIC_PRIO_BITS));
// critical section
__set_BASEPRI(0U); // remove the BASEPRI masking
// code after critical section