Skip to content

Commit 3629905

Browse files
committed
fix(rmt): legacy driver example
1 parent b295f9c commit 3629905

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

libraries/ESP32/examples/RMT/Legacy_RMT_Driver_Compatible/Legacy_RMT_Driver_Compatible.ino

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
/*
2+
* This example demonstrates how to use the file build_opt.h to disable the new RMT Driver
3+
* Note that this file shall be added the Arduino project
4+
*
5+
* If the content of this file changes, it is necessary to delete the compiled Arduino IDE cache
6+
* It can be done by changing, for instance, the "Core Debug Level" option, forcing the system to rebuild the Arduino Core
7+
*
8+
*/
9+
110
#ifndef NO_NEW_RMT_DRV
11+
212
// add the file "build_opt.h" to your Arduino project folder with "-DNO_NEW_RMT_DRV" to use the RMT Legacy driver
313
#warning "NO_NEW_RMT_DRV is not defined, using new RMT driver"
414

@@ -12,7 +22,9 @@ void setup() {
1222
}
1323

1424
void loop() {
15-
Serial.println("RMT New driver is installed: " + installed ? String("Yes.") : String("No."));
25+
String msg = "RMT New driver is installed: ";
26+
msg += (char*)(installed ? "Yes." : "No.");
27+
Serial.println(msg);
1628
delay(5000);
1729
}
1830

@@ -31,9 +43,10 @@ void setup() {
3143
}
3244

3345
void loop() {
34-
Serial.println("RMT Legacy driver is installed: " + installed ? String("Yes.") : String("No."));
46+
String msg = "RMT Legacy driver is installed: ";
47+
msg += (char*)(installed ? "Yes." : "No.");
48+
Serial.println(msg);
3549
delay(5000);
3650
}
3751

38-
39-
#endif
52+
#endif // NO_NEW_RMT_DRV

0 commit comments

Comments
 (0)