mirror of
https://github.com/meshtastic/firmware.git
synced 2026-09-23 06:45:24 -04:00
* thinknode-m9 variant * move lora to SPI1 device * enable SDcard * use HSPI * BaseUI tft -> HSPI * buzzer, webdav lib * fix build issues * M9 default to MUI, no BT, short ringtone * add keyboard long-press config * update variant * add ThingNode-M9 GPS string * GPS 115200 baud * Basic BaseUI support * Fixup power detection * Compass and KB fixes for M9 * add timed Lock::lock() * add SD card * point device-ui to thinknode m9 draft branch * trunk fmt * fix FusionCompass * Fix t-deck-tft linker arg list overflow in CI * SDcard/lora fix: SPI1 must not be declared twice in arduino 3.x -> reuse SPI1 defined in FSCommon.cpp * update battery parameters * reinit SD card when updating; fix PSRAM size * update lib versions * fix wakeup on key press (KB_INT) * fix default nag_timeout for TFT/MUI devices with buzzer * increase PSRAM and SD freq * trunk fmt * update lovyanGFX 1.2.26 * update device-ui commit reference * fix screen definition * remove DONE; maybe a keyword or other used identifier * fixed CI error nag_timeout * fix prepareSleep initialization * trunk fmt * reduce SD SPI frequency * update device-ui * fix SDcard issue * stage * fix device-ui commit reference * fix device-ui commit * update device-ui commit (fixed keyboard lag) * fix QMI8658 * trunk fmt * update .ini meta information, align SD freq * fix device-ui reference to target (ready to merge) * device-ui for all other targets * make the rabbit happy * trunk fmt * fixed lock screen * fix compile error * SPI lock timeout * apply device-ui fix * revert bad RadioLib commit hash in platformio.ini Co-authored-by: mverch67 <71137295+mverch67@users.noreply.github.com> * fix wrong commit hash change * fix fix commit fix * I love changing random numbers in random files --------- Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
56 lines
770 B
C++
56 lines
770 B
C++
#include "Lock.h"
|
|
#include "configuration.h"
|
|
#include <cassert>
|
|
|
|
namespace concurrency
|
|
{
|
|
|
|
#ifdef HAS_FREE_RTOS
|
|
Lock::Lock() : handle(xSemaphoreCreateBinary())
|
|
{
|
|
assert(handle);
|
|
if (xSemaphoreGive(handle) == false) {
|
|
abort();
|
|
}
|
|
}
|
|
|
|
Lock::~Lock()
|
|
{
|
|
vSemaphoreDelete(handle);
|
|
}
|
|
|
|
void Lock::lock()
|
|
{
|
|
if (xSemaphoreTake(handle, portMAX_DELAY) == false) {
|
|
abort();
|
|
}
|
|
}
|
|
|
|
bool Lock::lock(uint32_t timeout)
|
|
{
|
|
return xSemaphoreTake(handle, pdMS_TO_TICKS(timeout)) == pdTRUE;
|
|
}
|
|
|
|
void Lock::unlock()
|
|
{
|
|
if (xSemaphoreGive(handle) == false) {
|
|
abort();
|
|
}
|
|
}
|
|
#else
|
|
Lock::Lock() {}
|
|
|
|
Lock::~Lock() {}
|
|
|
|
void Lock::lock() {}
|
|
|
|
bool Lock::lock(uint32_t)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
void Lock::unlock() {}
|
|
#endif
|
|
|
|
} // namespace concurrency
|