mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-03 19:29:57 +00:00
30 lines
426 B
C++
30 lines
426 B
C++
#pragma once
|
|
|
|
#include "../freertosinc.h"
|
|
|
|
namespace concurrency
|
|
{
|
|
|
|
#ifndef HAS_FREE_RTOS
|
|
|
|
class BinarySemaphorePosix
|
|
{
|
|
// SemaphoreHandle_t semaphore;
|
|
|
|
public:
|
|
BinarySemaphorePosix();
|
|
~BinarySemaphorePosix();
|
|
|
|
/**
|
|
* Returns false if we timed out
|
|
*/
|
|
bool take(uint32_t msec);
|
|
|
|
void give();
|
|
|
|
void giveFromISR(BaseType_t *pxHigherPriorityTaskWoken);
|
|
};
|
|
|
|
#endif
|
|
|
|
} // namespace concurrency
|