39 void Coroutine::insertSorted() {
43 while (*p !=
nullptr) {
44 if (
getName().compareTo((*p)->getName()) <= 0)
break;
77 unsigned long m = ::millis();
78 #if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_SAMD) || defined(ESP8266) 80 return internal::udiv1000(m);
92 static const char kStatusSuspendedString[] PROGMEM =
"Suspended";
93 static const char kStatusYieldingString[] PROGMEM =
"Yielding";
94 static const char kStatusDelayingString[] PROGMEM =
"Delaying";
95 static const char kStatusRunningString[] PROGMEM =
"Running";
96 static const char kStatusEndingString[] PROGMEM =
"Ending";
97 static const char kStatusTerminatedString[] PROGMEM =
"Terminated";
99 const __FlashStringHelper*
const Coroutine::sStatusStrings[] = {
100 FPSTR(kStatusSuspendedString),
101 FPSTR(kStatusYieldingString),
102 FPSTR(kStatusDelayingString),
103 FPSTR(kStatusRunningString),
104 FPSTR(kStatusEndingString),
105 FPSTR(kStatusTerminatedString),
void resume()
Add a Suspended coroutine into the head of the scheduler linked list, and change the state to Yieldin...
const FCString & getName() const
Human-readable name of the coroutine.
static const Status kStatusYielding
Coroutine returned using the COROUTINE_YIELD() statement.
static const Status kStatusSuspended
Coroutine has been suspended using suspend() and the scheduler should remove it from the queue upon t...
All coroutines are instances of the Coroutine base class.
Various macros to smooth over the differences among the various platforms with regards to their suppo...
virtual unsigned long coroutineMillis() const
Returns the current millisecond clock.
virtual unsigned long coroutineSeconds() const
Returns the current clock in unit of seconds, truncated to the lower 16-bits.
Base class of all coroutines.
static Coroutine ** getRoot()
Get the pointer to the root pointer.
virtual unsigned long coroutineMicros() const
Returns the current millisecond clock.