Tool/software: Code Composer Studio
I was going through TDC_1000_basic_spi_readwrite 's code. In main.c to check if clock is stable the following code is used:-
do
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
// Clear XT2,DCO fault flags
SFRIFG1 &= ~OFIFG; // Clear fault flags
}while (SFRIFG1&OFIFG); // Test oscillator fault flag
How does this code works, when already SFRIFG1&=~OFIFG is used then why the condition in while will work.