Comments (1)
Obviously, if SerialDebug
is declared inside the #ifndef INCLUDE_UTIL_H_
section from 7_Utils.h
, it will not be possible to control its activation on a plugin by plugin basis.
This is because all the C files for each plugins are hard included in the main 5_Plugin.cpp
file, which in and of itself is an issue that would be worth looking at.
That being said, it is possible to allow a per plugin control, by moving the above macro definitions out of the #ifndef INCLUDE_UTIL_H_
section while adding a #undef
declaration at the end of the block, like so:
#ifdef SerialDebugActivated
#define SerialDebug(method, arguments...) Serial.method(arguments)
#else
#define SerialDebug(method, arguments...) /**/
#endif
#define SerialDebugPrintln(arguments...) SerialDebug(println, arguments)
#define SerialDebugPrint(arguments...) SerialDebug(print, arguments)
#undef SerialDebugActivated
This way, every plugin that includes 7_Utils.h
gets a chance to set SerialDebugActivated
for itself, effectively giving control on a per plugin basis.
However, this emits a warning: "SerialDebug" redefined
This is fixed by undefining it before redefining it, which gives the final following block:
#ifdef SerialDebugActivated
#undef SerialDebug
#define SerialDebug(method, arguments...) Serial.method(arguments)
#else
#undef SerialDebug
#define SerialDebug(method, arguments...) /**/
#endif
#define SerialDebugPrintln(arguments...) SerialDebug(println, arguments)
#define SerialDebugPrint(arguments...) SerialDebug(print, arguments)
#undef SerialDebugActivated
Obviously, there would be an explanation comment in front of that block in the pull request.
from rflink32.
Related Issues (20)
- Error 404 when flashing SonOff bridge
- Not all protocols working on esp32/cc1101 vs sonoff RFBridge HOT 1
- cc1101 bandwith setting HOT 1
- Different pins for SPI? HOT 1
- No TX-data signal for OOK transmitter HOT 1
- Reboot after NewKaku command HOT 1
- Very bad range with CC1101
- Help to send RTS commands
- Incorrect "SWITCH" value when sending HOT 1
- Support for ESP32-C3 HOT 1
- Using LILYGO Lora T3_V1.6.1
- AuriolV3 negative temperature not returned
- TFA Dostmann Devices can not be received HOT 1
- Decoding signal from SunFree remote
- Add support for Warema EWFS blinds
- Dooya remote signals not being decoded HOT 1
- Louvolite blinds remote signals not being decoded
- Help creating entities from MQTT HOT 7
- Convert temperature readings from HEX to value HOT 1
- PLungins 06
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rflink32.