I have an interrupt which is updating data, which can also be read using other functions.
I need to be able to read data knowing that it is not being updated mid way through the read.
On the S12 I would do this:
disable all interrupts using the DisableInterrupts function which would update the I bit in the CCR register.
perform the action
enable all interrupts using the EnableInterrupts function
What is the equivalent for the MPC5604?
Solved! Go to Solution.
You can e.g. set/clear EE bit in MSR register. See below the example of implementation using the custom macros.
#define DISABLE_INT __asm(wrteei 0)
#define ENABLE_INT __asm(wrteei 1)
void main(void)
{
ENABLE_INT;
DISABLE_INT;
}
Many thanks, that works great.
You can e.g. set/clear EE bit in MSR register. See below the example of implementation using the custom macros.
#define DISABLE_INT __asm(wrteei 0)
#define ENABLE_INT __asm(wrteei 1)
void main(void)
{
ENABLE_INT;
DISABLE_INT;
}