fix: resolve ESP32 compile errors and duplicate define#9
Open
netmindz wants to merge 1 commit into
Open
Conversation
- Add 'volatile' qualifier to edata parameter in _man_sample() and _man_decode() declarations (qqqDALI.h) and implementations (qqqDALI.cpp) to fix invalid implicit conversion from 'volatile uint8_t*' to 'uint8_t*' on ESP32/Arduino framework - Rename duplicate #define DALI_QUERY_OPERATING_MODE 252 (IEC62386-207) to DALI_QUERY_OPERATING_MODE_207 to eliminate compiler redefinition warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two issues prevent this library from compiling on ESP32 (Arduino/PlatformIO framework):
1.
volatile uint8_t*→uint8_t*implicit conversion errorThe ISR-filled receive buffer
rxdatais declaredvolatile uint8_t[]in the class. The private methods_man_sample()and_man_decode()accept it as a plainuint8_t *, which is an invalid implicit conversion in C++ (drops thevolatilequalifier). GCC on ESP32 rejects this as an error.Fix: Add
volatileto theedataparameter in both the declarations (qqqDALI.h) and implementations (qqqDALI.cpp) of_man_sample()and_man_decode().2. Duplicate
#define DALI_QUERY_OPERATING_MODEDALI_QUERY_OPERATING_MODEis defined twice inqqqDALI.h:158(IEC62386-102 ed2.0)252(IEC62386-207)This causes a
-Wmacro-redefinedcompiler warning and the second definition silently overrides the first.Fix: Rename the IEC62386-207 variant to
DALI_QUERY_OPERATING_MODE_207to make both definitions available without conflict.Testing
Verified to compile cleanly on ESP32 (esp32dev, IDF v4 / Arduino core 2.x) via PlatformIO.