You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#pragma once
#include "osbasic_h.hpp"
namespace iflytop {
typedef function<void()> zosthread_cb_t;
class ZThread { public: const char* m_name; size_t m_stacksize; osPriority m_uxPriority;
bool m_threadisworkingFlag = false; bool m_threadisWaitingForStopFlag = false; bool m_threadisworkingFlagCallSide = false;
zosthread_cb_t m_taskfunction; EventGroupHandle_t m_zthreadstartworkevent;
osThreadId m_defaultTaskHandle;
SemaphoreHandle_t m_lock;
public: void init(const char* threadname, int stack_size = 1024, osPriority priority = osPriorityNormal); void start(zosthread_cb_t cb); void stop();
void sleep(uint32_t ms); void wake(); };
} // namespace iflytop
|