138 TaskBase(TaskHandle_t handle) : taskHandle(handle) {
148#if INCLUDE_vTaskDelete
150 vTaskDelete(taskHandle);
166 static void delay(TickType_t time) { vTaskDelay(time); }
167#if FREERTOSCPP_USE_CHRONO
174 static void delay(Time_ms ms) { vTaskDelay(ms2ticks(ms)); }
177#if INCLUDE_xTaskDelayUntil
198 static bool delayUntil(TickType_t& prev, TickType_t time) {
return xTaskDelayUntil(&prev, time);}
199#if FREERTOSCPP_USE_CHRONO
220 static bool delayUntil(TickType_t& prev, Time_ms ms) {
return xTaskDelayUntil(&prev, ms2ticks(ms)); }
222#elif INCLUDE_vTaskDelayUntil
240 static void delayUntil(TickType_t& prev, TickType_t time) { vTaskDelay(&prev, time); }
241#if FREERTOSCPP_USE_CHRONO
259 static void delayUntil(TickType_t& prev, Time_ms ms) { vTaskDelay(&prev, ms2ticks(ms)); }
263#if INCLUDE_xTaskAbortDelay
268 bool abortDelay() {
return xTaskAbortDelay(taskHandle); }
271#if INCLUDE_uxTaskPriorityGet
281 #if INCLUDE_vTaskPrioritySet
291 #if INCLUDE_vTaskSuspend
304 void resume() { vTaskResume(taskHandle); }
307 # if INCLUDE_xTaskResumeFromISR
316 bool resume_ISR() {
return xTaskResumeFromISR(taskHandle); }
324 bool notify(uint32_t value, eNotifyAction act)
325 {
return xTaskNotify(taskHandle, value, act); }
326 bool notify_ISR(uint32_t value, eNotifyAction act, portBASE_TYPE& waswoken)
327 {
return xTaskNotifyFromISR(taskHandle, value, act, &waswoken);}
329 {
return xTaskNotifyAndQuery(taskHandle, value, act, &old); }
330 bool notify_query_ISR(uint32_t value, eNotifyAction act, uint32_t &old, portBASE_TYPE& waswoken)
331 {
return xTaskNotifyAndQueryFromISR(taskHandle, value, act, &old, &waswoken); }
332#if FREERTOS_VERSION_ALL >= 10'004'000
333 bool notifyIndex(UBaseType_t idx, uint32_t value, eNotifyAction act)
334 {
return xTaskNotifyIndexed(taskHandle, idx, value, act); }
335 bool notifyIndex_ISR(UBaseType_t idx, uint32_t value, eNotifyAction act, portBASE_TYPE& waswoken)
336 {
return xTaskNotifyIndexedFromISR(taskHandle, idx, value, act, &waswoken);}
337 bool notifyIndex_query(UBaseType_t idx, uint32_t value, eNotifyAction act, uint32_t &old)
338 {
return xTaskNotifyAndQueryIndexed(taskHandle, idx, value, act, &old); }
339 bool notifyIndex_query_ISR(UBaseType_t idx, uint32_t value, eNotifyAction act, uint32_t &old, portBASE_TYPE& waswoken)
340 {
return xTaskNotifyAndQueryIndexedFromISR(taskHandle, idx, value, act, &old, &waswoken); }
343#if FREERTOS_VERSION_ALL >= 10'003'000
344 bool notifyStateClear() {
return xTaskNotifyStateClear(taskHandle); }
345 uint32_t notifyValueClear(uint32_t bits) {
return ulTaskNotifyValueClear(taskHandle, bits); }
346#if FREERTOS_VERSION_ALL >= 10'004'000
347 bool notifyStateClearIndex(UBaseType_t idx) {
return xTaskNotifyStateClearIndexed(taskHandle, idx); }
348 uint32_t notifyValueClearIndex(UBaseType_t idx, uint32_t bits) {
return ulTaskNotifyValueClearIndexed(taskHandle, idx, bits); }
357 bool give() {
return xTaskNotifyGive(taskHandle); }
359 { vTaskNotifyGiveFromISR(taskHandle, &waswoken); }
361#if FREERTOS_VERSION_ALL >= 10'004'000
362 bool giveIndex(UBaseType_t idx) {
return xTaskNotifyGiveIndexed(taskHandle, idx); }
363 void giveIndex_ISR(UBaseType_t idx, portBASE_TYPE& waswoken)
364 { vTaskNotifyGiveIndexedFromISR(taskHandle, idx, &waswoken); }
370 static uint32_t
wait(uint32_t clearEnter, uint32_t clearExit = 0xFFFFFFFF, uint32_t* value =
nullptr, TickType_t ticks = portMAX_DELAY)
371 {
return xTaskNotifyWait(clearEnter, clearExit, value, ticks); }
372#if FREERTOSCPP_USE_CHRONO
373 static uint32_t wait(uint32_t clearEnter, uint32_t clearExit, uint32_t* value, Time_ms ms)
374 {
return xTaskNotifyWait(clearEnter, clearExit, value, ms2ticks(ms)); }
376#if FREERTOS_VERSION_ALL >= 10'004'000
377 static uint32_t waitIndex(UBaseType_t idx, uint32_t clearEnter, uint32_t clearExit = 0xFFFFFFFF, uint32_t* value =
nullptr, TickType_t ticks = portMAX_DELAY)
378 {
return xTaskNotifyWaitIndexed(idx, clearEnter, clearExit, value, ticks); }
379#if FREERTOSCPP_USE_CHRONO
380 static uint32_t waitIndex(UBaseType_t idx, uint32_t clearEnter, uint32_t clearExit, uint32_t* value, Time_ms ms)
381 {
return xTaskNotifyWaitIndexed(idx, clearEnter, clearExit, value, ms2ticks(ms)); }
398 static uint32_t
take(
bool clear =
true, TickType_t ticks = portMAX_DELAY)
399 {
return ulTaskNotifyTake(clear, ticks); }
400#if FREERTOSCPP_USE_CHRONO
414 static uint32_t take(
bool clear, Time_ms ticks)
415 {
return ulTaskNotifyTake(clear, ms2ticks(ticks)); }
421#if __cplusplus < 201101L