feat(rak3112): add conditional macros for rakwireless-audio library support#12399
Conversation
👋 Hello Ethan-chen1234-zy, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
…upport (espressif#12399) * feat(rak3112): add conditional macros for rakwireless-audio library support * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Add a variant-specific macro VARIANT_RAK3112 to pins_arduino.h to enable conditional compilation in Audio-related libraries (e.g., PDM, I2S configurations) that need to detect the RAK3112 board.
Changes
Added a header guard wrapper for RAK3112 variant at the beginning of pins_arduino.h:
#ifndef VARIANT_RAK3112
#define VARIANT_RAK3112
#endif
No other pins or definitions were modified, ensuring full backward compatibility.
Impact
This change does not affect existing functionality. It simply provides a standard way for libraries to check if the target board is RAK3112.
Testing
Compiled with Arduino IDE using board "RAK3112" and verified that the macro is correctly defined.
Tested with a custom Audio library that conditionally enables board-specific I2S pins and PDM settings; confirmed it compiles and runs without errors.
Additional Notes
This change is part of the ongoing effort to improve Audio support for RAK3112 (branch feature/rak3112-add-audio-support). The macro allows libraries to avoid hardcoding board checks based on other pins or assumptions.