Skip to content
RED SAGSkills
easy5 pts · first answer countsfirmwarec-language

Why registers are volatile

A driver polls a status register through a pointer. With optimisation on, the loop never exits even though the hardware sets the flag. What is the most likely fix?

uint32_t *SR = (uint32_t *)0x40011000;
while ((*SR & (1u << 5)) == 0) { }
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions