fix CPU usage of esp32c3 with ml307
This commit is contained in:
@ -13,7 +13,7 @@ public:
|
||||
BackgroundTask(uint32_t stack_size = 4096 * 2);
|
||||
~BackgroundTask();
|
||||
|
||||
void Schedule(std::function<void()> callback);
|
||||
bool Schedule(std::function<void()> callback);
|
||||
void WaitForCompletion();
|
||||
|
||||
private:
|
||||
@ -21,7 +21,8 @@ private:
|
||||
std::list<std::function<void()>> background_tasks_;
|
||||
std::condition_variable condition_variable_;
|
||||
TaskHandle_t background_task_handle_ = nullptr;
|
||||
std::atomic<size_t> active_tasks_{0};
|
||||
int active_tasks_ = 0;
|
||||
int waiting_for_completion_ = 0;
|
||||
|
||||
void BackgroundTaskLoop();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user