Look at this code, this is existing code used when building an app for the STM device F446RE, a simple LED blinker.

Not sure if this is STM authored code or what, but look at it.
In my case GPIO_NUMBER happens to be 16, so it loops 16 times before it finds iocurrent == ioposition, that seems rather costly to me.
Why not simply compute ioposition rather than looping like that?

Not sure if this is STM authored code or what, but look at it.
In my case GPIO_NUMBER happens to be 16, so it loops 16 times before it finds iocurrent == ioposition, that seems rather costly to me.
Why not simply compute ioposition rather than looping like that?
Attachments
-
41.2 KB Views: 4