Dec 21, 2016
06:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 21, 2016
06:05 AM
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?
5 Replies
Dec 21, 2016
08:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 21, 2016
08:12 AM
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
Dec 21, 2016
09:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 21, 2016
09:42 AM
Is there a proper way to re-define a value?
Dec 21, 2016
10:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 21, 2016
10:27 AM
As I said: No.
Bob
Dec 21, 2016
11:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 21, 2016
11:18 AM
I mean at compile-time.
Dec 21, 2016
11:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 21, 2016
11:42 AM
Re-#define the macro and ignore the warning.
Bob