FastLED 3.10.8
Loading...
Searching...
No Matches
DriverTest.ino
Go to the documentation of this file.
1// @filter: (platform is esp32)
100
101#include <FastLED.h>
102#include "PlatformConfig.h"
103#include "TestRunner.h"
104
105// ============================================================================
106// LED ARRAY
107// ============================================================================
108
110
111// ============================================================================
112// ARDUINO SETUP
113// ============================================================================
114
115void setup() {
116 // Initialize serial communication
117 Serial.begin(115200);
118 delay(1000); // Allow time for serial monitor connection
119
120 Serial.println("SpecialDrivers/ESP/DriverTest setup starting");
121
122#if defined(FL_QEMU_VALIDATE_LCD_CLOCKLESS)
123 // Espressif QEMU does not model LCD_CAM transmit-completion interrupts.
124 // Validate the strongest supported behavior: link and register the real
125 // ESP32-S3 LCD clockless driver without requiring a private BusTraits
126 // header in this public example.
127 FastLED.enableAllDrivers();
128 bool lcdClocklessRegistered = false;
129 const auto drivers = FastLED.getDriverInfos();
130 for (fl::size i = 0; i < drivers.size(); ++i) {
131 if (fl::strcmp(drivers[i].name.c_str(), "LCD_CLOCKLESS") == 0) {
132 lcdClocklessRegistered = true;
133 break;
134 }
135 }
136 Serial.println(lcdClocklessRegistered
137 ? "QEMU_LCD_CLOCKLESS_REGISTRATION: PASS"
138 : "QEMU_LCD_CLOCKLESS_REGISTRATION: FAIL");
139 return;
140#endif
141
142 // Initialize FastLED with WS2812 strip
143 // The driver can be switched at runtime using setExclusiveDriver()
144 FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS);
145 FastLED.setBrightness(TEST_BRIGHTNESS);
146
147 // Create and run the test suite
149 runner.runAllTests();
150 runner.printSummary();
151}
152
153// ============================================================================
154// ARDUINO LOOP
155// ============================================================================
156
157void loop() {
158 // Tests complete - nothing to do in loop
159 // Results were printed in setup()
160 delay(10000);
161}
CRGB leds[1]
#define NUM_LEDS
#define DATA_PIN
Definition ClientReal.h:82
void setup()
void loop()
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
#define TEST_BRIGHTNESS
Brightness level (0-255), 64 = 25% for safe testing.
ESP32 Platform Detection and Configuration.
Test Runner for ESP32 Driver Testing.
void runAllTests()
Run all tests: validation + driver tests.
Definition TestRunner.h:74
void printSummary()
Print final test summary with pass/fail status.
Definition TestRunner.h:81
Main test runner that orchestrates all driver tests.
Definition TestRunner.h:61
constexpr EOrder GRB
Definition eorder.h:19
fl::CRGB CRGB
Definition crgb.h:25
FASTLED_FORCE_INLINE int strcmp(const char *s1, const char *s2) FL_NO_EXCEPT
Definition cstring.h:60
#define Serial
Definition serial.h:309