-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(rmt): allow legacy driver * feat(rmt): legacy driver example * fix(rmt): legacy driver example * fix(rmt): ESP32_ARDUINO_NEW_RMT_DRV_OFF * fix(rmt): ESP32_ARDUINO_NEW_RMT_DRV_OFF * fix(rmt): ESP32_ARDUINO_NEW_RMT_DRV_OFF * fix(rmt): GPIO HAL only * fix(rmt): error case * fix(rmt): not necessary change * ci(pre-commit): Apply automatic fixes * ci(pre-commit): Ignore build_opt in clangformat --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Lucas Saavedra Vaz <[email protected]>
- Loading branch information
1 parent
4a6437d
commit 3686344
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
38 changes: 38 additions & 0 deletions
38
libraries/ESP32/examples/RMT/Legacy_RMT_Driver_Compatible/Legacy_RMT_Driver_Compatible.ino
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* This example demonstrates how to use the file build_opt.h to disable the new RMT Driver | ||
* Note that this file shall be added the Arduino project | ||
* | ||
* If the content of this file changes, it is necessary to delete the compiled Arduino IDE cache | ||
* It can be done by changing, for instance, the "Core Debug Level" option, forcing the system to rebuild the Arduino Core | ||
* | ||
*/ | ||
|
||
#ifndef ESP32_ARDUINO_NO_RGB_BUILTIN | ||
|
||
// add the file "build_opt.h" to your Arduino project folder with "-DESP32_ARDUINO_NO_RGB_BUILTIN" to use the RMT Legacy driver | ||
#error "ESP32_ARDUINO_NO_RGB_BUILTIN is not defined, this example is intended to demonstrate the RMT Legacy driver. | ||
#error "Please add the file 'build_opt.h' with '-DESP32_ARDUINO_NO_RGB_BUILTIN' to your Arduino project folder." | ||
#error "Another way to disable the RGB_BUILTIN is to define it in the platformio.ini file, for instance: '-D ESP32_ARDUINO_NO_RGB_BUILTIN'" | ||
|
||
#else | ||
|
||
// add the file "build_opt.h" to your Arduino project folder with "-DESP32_ARDUINO_NO_RGB_BUILTIN" to use the RMT Legacy driver | ||
// neoPixelWrite() is a function that writes to the RGB LED and it won't be available here | ||
#include "driver/rmt.h" | ||
|
||
bool installed = false; | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
Serial.println("This sketch is using the RMT Legacy driver."); | ||
installed = rmt_driver_install(RMT_CHANNEL_0, 0, 0) == ESP_OK; | ||
} | ||
|
||
void loop() { | ||
String msg = "RMT Legacy driver is installed: "; | ||
msg += (char *)(installed ? "Yes." : "No."); | ||
Serial.println(msg); | ||
delay(5000); | ||
} | ||
|
||
#endif // ESP32_ARDUINO_NO_RGB_BUILTIN |
1 change: 1 addition & 0 deletions
1
libraries/ESP32/examples/RMT/Legacy_RMT_Driver_Compatible/build_opt.h
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-DESP32_ARDUINO_NO_RGB_BUILTIN |