mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
31 lines
434 B
C
31 lines
434 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "configuration.h"
|
||
|
|
#include "../freertosinc.h"
|
||
|
|
|
||
|
|
namespace concurrency
|
||
|
|
{
|
||
|
|
|
||
|
|
#ifdef HAS_FREE_RTOS
|
||
|
|
|
||
|
|
class BinarySemaphoreFreeRTOS
|
||
|
|
{
|
||
|
|
SemaphoreHandle_t semaphore;
|
||
|
|
|
||
|
|
public:
|
||
|
|
BinarySemaphoreFreeRTOS();
|
||
|
|
~BinarySemaphoreFreeRTOS();
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Returns false if we timed out
|
||
|
|
*/
|
||
|
|
bool take(uint32_t msec);
|
||
|
|
|
||
|
|
void give();
|
||
|
|
|
||
|
|
void giveFromISR(BaseType_t *pxHigherPriorityTaskWoken);
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|
||
|
|
|
||
|
|
}
|