Re:Bare Metal STM32 Programming and a Quadcopters Awakening
by dmitrygr on Tuesday March 05, 2019 @08:23PM
(#19315732)
Actually that line is not ok. But for another reason. Without "volatile" in there, the compiler may reorder this access with others, or remove it, or combine it with others. None of that is good.
[ Parent
| on HN ]
Re:Bare Metal STM32 Programming and a Quadcopters Awakening
by arcticbull on Tuesday March 05, 2019 @08:42PM
(#19315798)
That's a very important call-out. This is the kind of tear-your-hair-out stuff that's going to be very difficult to track down unless you get it exactly right. I echo that using the definitions makes the code infinitely more readable and writeable, and makes zero difference in terms of performance.