Skip to content

fix: resolve ESP32 compile errors and duplicate define#9

Open
netmindz wants to merge 1 commit into
qqqlab:mainfrom
netmindz:fix/esp32-volatile-cast
Open

fix: resolve ESP32 compile errors and duplicate define#9
netmindz wants to merge 1 commit into
qqqlab:mainfrom
netmindz:fix/esp32-volatile-cast

Conversation

@netmindz
Copy link
Copy Markdown

Summary

Two issues prevent this library from compiling on ESP32 (Arduino/PlatformIO framework):

1. volatile uint8_t*uint8_t* implicit conversion error

The ISR-filled receive buffer rxdata is declared volatile uint8_t[] in the class. The private methods _man_sample() and _man_decode() accept it as a plain uint8_t *, which is an invalid implicit conversion in C++ (drops the volatile qualifier). GCC on ESP32 rejects this as an error.

Fix: Add volatile to the edata parameter in both the declarations (qqqDALI.h) and implementations (qqqDALI.cpp) of _man_sample() and _man_decode().

2. Duplicate #define DALI_QUERY_OPERATING_MODE

DALI_QUERY_OPERATING_MODE is defined twice in qqqDALI.h:

  • Line 307: 158 (IEC62386-102 ed2.0)
  • Line 401: 252 (IEC62386-207)

This causes a -Wmacro-redefined compiler warning and the second definition silently overrides the first.

Fix: Rename the IEC62386-207 variant to DALI_QUERY_OPERATING_MODE_207 to make both definitions available without conflict.

Testing

Verified to compile cleanly on ESP32 (esp32dev, IDF v4 / Arduino core 2.x) via PlatformIO.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant