cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor

Is there a way for you to redefine a value in code? 

   

For instance, if I have "#define CapSense_AUTOCALIBRATION_ENABLE (1u)" set by my CapSense module, is there a way in my code to re-define this to (0u) depending on a specific input? If so, how could I possibly go about doing this?

0 Likes
Reply
5 Replies
Esteemed Contributor II

The #define is a macro command that goes to the C-compiler and as such is fixed at compile-time. You may re-define the value, but again: only at compile-time.

   

 

   

Bob

0 Likes
Reply
New Contributor

Is there a proper way to re-define a value?

0 Likes
Reply
Esteemed Contributor II

As I said: No.

   

 

   

Bob

0 Likes
Reply
New Contributor

I mean at compile-time.

0 Likes
Reply
Esteemed Contributor II

Re-#define the macro and ignore the warning.

   

 

   

Bob

0 Likes
Reply