Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4924

Important variables in toggle_pin() being optimized out

$
0
0
Hello, I am using the pio_toggle_pin method and when I step into it, I can see that an important variable is being optimized out. Needless to say the pio_toggle_pin() method doesn't work as expected and the pin stays high. I suspect that it isn't getting initialized, but I copied the code from an atmel example project. Why would the compiler do this? How can I fix it? This happens with normal optimization enabled.
When I disable optimization the pin stays low and has a quick jump in voltage...

Important variables in toggle_pin() being optimized out

Viewing all articles
Browse latest Browse all 4924

Trending Articles