FastLED 3.9.15
Loading...
Searching...
No Matches

◆ testSingleDriver()

bool DriverTestRunner::testSingleDriver ( const char * driverName)
inlineprivate

Test a single driver with LED patterns.

Parameters
driverNameName of driver to test
Returns
true if driver was tested successfully

Definition at line 258 of file TestRunner.h.

258 {
259 fl::sstream ss;
260 ss << "\n" << LINE_SEP;
261 ss << "Testing driver: " << driverName << "\n";
262 ss << LINE_SEP;
263 Serial.print(ss.str().c_str());
264
265 // Attempt to set this driver as exclusive. `driverName` is a runtime
266 // string (the test iterates over discovered drivers by name), so we use
267 // the by-name escape hatch on ChannelManager rather than the typed
268 // FastLED.setExclusiveDriver(fl::Bus) overload. Make sure every driver
269 // is enrolled first so the lookup can succeed.
271 if (!fl::ChannelManager::instance().setExclusiveDriverByName(driverName)) {
272 Serial.print(" [SKIP] Could not set ");
273 Serial.print(driverName);
274 Serial.println(" as exclusive driver (not available)");
275 return false;
276 }
277
278 Serial.print(" [INFO] ");
279 Serial.print(driverName);
280 Serial.println(" set as exclusive driver");
281
282 // Run visual test patterns
284
285 // Record success
286 fl::sstream resultMsg;
287 resultMsg << driverName << " driver test completed";
288 recordResult(resultMsg.str().c_str(), true);
289
290 return true;
291 }
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
#define LINE_SEP
Definition TestRunner.h:30
static void enableAllDrivers()
Enroll every channel driver available on this platform with ChannelManager.
void recordResult(const char *name, bool passed)
Record a test result.
Definition TestRunner.h:136
void runTestPatterns()
Run visual LED test patterns.
Definition TestRunner.h:294
static ChannelManager & instance() FL_NOEXCEPT
Get the global singleton instance.
const char * c_str() const FL_NOEXCEPT
string str() const FL_NOEXCEPT
Definition strstream.h:43
#define Serial
Definition serial.h:304

References fl::basic_string::c_str(), FastLED, fl::ChannelManager::instance(), LINE_SEP, recordResult(), runTestPatterns(), Serial, and fl::sstream::str().

Referenced by testAllDrivers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: