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

Method create

src/platforms/arm/teensy/coroutine_teensy.impl.hpp:284–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282//=============================================================================
283
284TaskCoroutinePtr TaskCoroutineTeensy::create(
285 fl::string name,
286 TaskFunction function,
287 size_t stack_size,
288 u8 /*priority*/) FL_NOEXCEPT {
289 auto* ctx = CoroutineContext::create(fl::move(function), stack_size);
290 if (!ctx) {
291 FL_WARN("TaskCoroutineTeensy: Failed to create context for '" << name << "'");
292 return nullptr;
293 }
294
295 TaskCoroutinePtr task(new TaskCoroutineTeensy()) FL_NOEXCEPT; // ok bare allocation
296 auto* impl = static_cast<TaskCoroutineTeensy*>(task.get());
297 impl->mName = fl::move(name);
298 impl->mContext.reset(ctx);
299
300 // Register with the global runner
301 CoroutineRunner::instance().enqueue(ctx);
302
303 return task;
304}
305
306TaskCoroutineTeensy::~TaskCoroutineTeensy() {
307 stop();

Callers

nothing calls this directly

Calls 4

createFunction · 0.85
getMethod · 0.45
resetMethod · 0.45
enqueueMethod · 0.45

Tested by

no test coverage detected