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

Function setupRpcAsyncTask

examples/AutoResearch/AutoResearchAsync.h:34–40  ·  view source on GitHub ↗

@brief Setup async task for JSON-RPC processing @param remote_control Reference to RemoteControl singleton @param interval_ms Task interval in milliseconds (default: 10ms) @return Task handle (auto-registered with scheduler) This function creates an async task that polls the RPC system at regular intervals, allowing RPC commands to be processed without blocking the main loop. The 10ms default in

Source from the content-addressed store, hash-verified

32/// - ESP32 Arduino runs on single core - task switching is atomic
33/// - No additional synchronization needed
34inline fl::task::Handle setupRpcAsyncTask(AutoResearchRemoteControl& remote_control, int interval_ms = 10) {
35 return fl::task::every_ms(interval_ms, FL_TRACE)
36 .then([&remote_control]() {
37 uint32_t current_time = millis();
38 remote_control.tick(current_time); // Calls Remote::update() which does pull + tick + push
39 });
40}
41
42/// @brief On FL_IS_STUB: register a one-shot async task that drives autoresearch
43///

Callers

nothing calls this directly

Calls 3

every_msFunction · 0.85
millisFunction · 0.50
tickMethod · 0.45

Tested by

no test coverage detected