You are here

Enter value during debugging | Cypress Semiconductor

Enter value during debugging

Summary: 2 Replies, Latest post by PSoC Rocks on 11 Feb 2013 10:54 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
user_228878049's picture
152 posts

 I have a complex project wherein I want to see whether the deviceundergoes a step by step execution of particular part of code.

So when I debug, I want the code execution to come and halt at this part of code and shoulkd not execute further. 

Can this be done with while( variable); with value defined greater than 0 when initialised and set to 0 during debug???

user_14586677's picture
7646 posts

Use #define and #ifdef, #endef to control constant to be

assigned to a variable.


#define DEBUG



x = 20              // Normal variable value

#ifdef DEBUG

x = 10             // Debug value



When you comment out the #define then thats normal program settings.

Note these are much mroe flexible control statements. Like macro definitions,



Regards, Dana.

PSoC Rocks's picture
141 posts

 Why not using the Breakpoint feature? It will stop the code execution just at the previous line.

Log in to post new comments.