|
|
View previous topic :: View next topic |
Author |
Message |
Felix Althaus
Joined: 09 Sep 2003 Posts: 67 Location: Winterthur, Switzerland
|
temporary undoing a #define (?) |
Posted: Wed Jan 14, 2004 10:30 am |
|
|
Hello
I have this code:
#define BUTTON PIN_A1
[...]
#if(BUTTON / 8 != 5)
#error BUTTON has to be on PortA
#endif
I want to check, if BUTTON was assigned to a pin on Port A. If not a message should appear. The problem is, that in the error message BUTTON is replaced by the internal compiler value (ok, I know, the pre-processor does here what he sould do...).
Is there a way I can "undefine" BUTTON just for this time so it will print "BUTTON" instead of a number?
Many thanks
Felix |
|
|
Ttelmah Guest
|
Re: temporary undoing a #define (?) |
Posted: Wed Jan 14, 2004 11:24 am |
|
|
Felix Althaus wrote: | Hello
I have this code:
#define BUTTON PIN_A1
[...]
#if(BUTTON / 8 != 5)
#error BUTTON has to be on PortA
#endif
I want to check, if BUTTON was assigned to a pin on Port A. If not a message should appear. The problem is, that in the error message BUTTON is replaced by the internal compiler value (ok, I know, the pre-processor does here what he sould do...).
Is there a way I can "undefine" BUTTON just for this time so it will print "BUTTON" instead of a number?
Many thanks
Felix |
#if(BUTTON / 8 != 5)
#undef BUTTON
#error BUTTON has to be on PortA
#endif |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|