Debug a basic C++ program on STMCube IDE
Here's my infinite loop in a cpp file
#include "main.h"
#include "lib.hpp"
void run() {
auto cnt = 0u;
while (1) {
if(!HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13))
cnt++;
}
}I run the Debugger and execute the statements until I get to the "if" statement above then when pressing F6 another time the execution stops waiting to read the value of pin 13 (the blue button on the board). But while I have also added "cnt" onto the "live expressions" its value doesn't go beyond 0 even though I press the button couple of times.
My purpose is to see the value of "cnt" after pressing the button no matter how much it is.
