This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

reading a register to clear it

Sometimes in cortex M3 there are registers which get cleared on reading. like some of int registers.

Now if use

uint32_t dummy = read_register();

then if will clear the register but compiler generate warning that dummy not used again, which is ok, now this can be removed by
if(dummy){}.

But can it be done by below statement:

(void)(read_regsiter());

Will it clear the register also