A simple question about READ_REG() macro and double layers of parentheses
Hi,
It may seem simple to you, but it confuses me for a bit of time after I saw:
uint32_t isrflags = READ_REG(huart->Instance->SR);
and
#define READ_REG(REG) ((REG))
I have 2 questions here:
huart->Instance->SR should be an address, how does READ_REG(REG) get the data from it without using like:
#define READ_REG(REG) (*(REG))
Why there are double layers of parentheses for REG as ((REG))? I searched but seems get nothing.
Thanks so much for your time!
Regards,
