MCPcopy Create free account
hub / github.com/FastLED/FastLED / toggleFastLED

Function toggleFastLED

src/platforms/wasm/compiler/index.ts:1056–1069  ·  view source on GitHub ↗

* Toggles the FastLED animation loop * @returns {Promise } Promise that resolves to running state (true if now running)

()

Source from the content-addressed store, hash-verified

1054 * @returns {Promise<boolean>} Promise that resolves to running state (true if now running)
1055 */
1056async function toggleFastLED() {
1057 if (!fastLEDController) {
1058 console.error('FastLED controller not initialized');
1059 return false;
1060 }
1061
1062 if (fastLEDController.running) {
1063 await fastLEDController.stopWithWorkerSupport();
1064 return false;
1065 } else {
1066 await fastLEDController.startWithWorkerSupport();
1067 return true;
1068 }
1069}
1070
1071/**
1072 * Sets up global error handlers for unhandled promise rejections

Callers 1

FastLED_SetupAndLoopFunction · 0.85

Calls 3

stopWithWorkerSupportMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected