Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

compiler optimization level nrf api going wrong

sdk 17.0.2

IDE - segger embedded studio 

For the below given code, "pin" is not updating when GPIO goes high when optimization level is kept  "Level 3 for more speed". upto "level 2" , "pin" is updating properly.

Could you please let me know why the update is not happening for Level3 optimization ? I added "volatile" qualifier for variable "pin", but still not working

bool pin;

nrf_gpio_cfg_watcher(PIN12);

pin= nrf_gpio_pin_read(PIN12);

Parents Reply Children
No Data
Related