Content originally posted in LPCWare by curtvm on Fri Jan 28 11:45:10 MST 2011
How do you know what the reserved bits will be? If any of them are set, your comparison will fail.
To clear all the reset bits-
LPC_SYSCON->SYSRESSTAT = 0b11111; //0x1F
//or write a 1 to whichever bit (s) you want cleared
Before clearing, you could save them to a var for later if wanted.
I don't think you want to do any &= |= since you need to write a one to clear a bit. If you are trying to clear specific bits this way, you will inadvertently clear others.