coroutine: kinda works now

This commit is contained in:
Kevin Hester
2020-10-10 09:57:57 +08:00
parent 4b9ea4f808
commit 49b4ed2a89
31 changed files with 392 additions and 150 deletions

View File

@@ -21,24 +21,30 @@ class NotifiedWorkerThread : public OSThread
/**
* Notify this thread so it can run
*/
void notify(uint32_t v, bool overwrite);
bool notify(uint32_t v, bool overwrite);
/**
* Notify from an ISR
*
* This must be inline or IRAM_ATTR on ESP32
*/
void notifyFromISR(BaseType_t *highPriWoken, uint32_t v, bool overwrite);
bool notifyFromISR(BaseType_t *highPriWoken, uint32_t v, bool overwrite);
/**
* Schedule a notification to fire in delay msecs
*/
void notifyLater(uint32_t delay, uint32_t v, bool overwrite);
bool notifyLater(uint32_t delay, uint32_t v, bool overwrite);
protected:
virtual void onNotify(uint32_t notification) = 0;
virtual uint32_t runOnce();
virtual int32_t runOnce();
private:
/**
* Notify this thread so it can run
*/
bool notifyCommon(uint32_t v, bool overwrite);
};
} // namespace concurrency