Ifndef Not Working For RX2/TX2 Redefinition · Issue #4583 - GitHub
Maybe your like
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} espressif / arduino-esp32 Public 
jshep321opened on Nov 26, 2020
- Notifications You must be signed in to change notification settings
- Fork 7.8k
- Star 15.9k
- Code
- Issues 112
- Pull requests 16
- Discussions
- Actions
- Projects 2
- Wiki
- Security
Uh oh!
There was an error while loading. Please reload this page.
- Insights
Description
I am trying to redefine the pins for my serial port using Serial2 -- RX2/TX2. If I comment out the #define in HardwareSerial.cpp, everything works as expected with my new pins. This works:
#ifndef RX2 #define RX2 16 //default //#define RX2 14 //esp32cam available pin #endif #ifndef TX2 #define TX2 17 //default //#define TX2 15 //esp32cam available pinHowever, if I #define them in my application, the defaults are used and the #ifndef are ignored. Any suggestions on how to make these visible without editing the (common file) HardwareSerial.cpp?
Metadata
Metadata
Assignees
No one assignedLabels
Issue is stale stage (outdated/stuck)Type
No typeProjects
No projectsMilestone
No milestoneRelationships
None yetDevelopment
No branches or pull requestsIssue actions
You can’t perform that action at this time.Tag » Arduino Ifndef Not Working
-
IDE - Ignoring '#ifndef' Directive - Arduino Forum
-
Arduino #ifndef Compiler Directive Issues - Programming Questions
-
Does #ifdef / #if Defined() Not Work On Arduino IDE?
-
Ifdef Does Not Work At All On Due - Arduino Forum
-
Ifdef Doesn't Seem To Be Working - Arduino Forum
-
Ifndef Causing Compile Problems - Arduino Forum
-
Why Wont These 2 Lines Of Code Work Inside My #ifdef/#endif
-
Ifdef Does Not Compile, // Does - Arduino Forum
-
[SOLVED] #ifndef Not Working? - AVR Freaks
-
How Do I Avoid The "multiple Definition Of ..." Error In This Case
-
Arduino Preprocessor Directives Tutorial - Ifdef & Endif - Device Plus
-
How To Properly Hardcode Compiler's Define Flag - Stack Overflow
-
Problems With Library, #include And #ifdef - PlatformIO Community
-
Arduino Compiler Problem With #ifdefs Solved. - Sub-Etha Software