This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Ideas of why this may happen? printf makes my code work o.O

Hello to all

I have the next code, basically what it does is reading a button state and if it is pressed then the manufacturer data of the BLE package is lets say B, on the contrary when the button is not pressed the data is A.

image description

The riddle comes if I comment the printf line, that as you can see doesn't do anything with the variable, then the manufacturer data is never changed even if the button is pressed for a long time. I've tried changing the printf for a delay, does not work, reading the state before and after this line doesn't matter, as long as I'm doing the instruction.

And for power consumption reasons I can't have the uart module working.

Thanks in advance for your help

Related