I am using MPC5748G micrcontroller.
During executing some operations I want to disable interrupts and then want enable interrupts. Below is the code I that i am using for the same.
Please let me know is this correct implementation ? you can also suggest me better method.
/* Disable Interrupt */
#define DISABLE_INTERRUPT \
__asm volatile("mfmsr %0" : "=r" (msr) :);\
if (msr & (uint32)0x00008000UL)\
__asm(" wrteei 0");
/* Enable Interrupt */
#define ENABLE_INTERRUPT \
if (msr & (uint32)0x00008000UL)\
__asm(" wrteei 1");