first commit
This commit is contained in:
commit
5893b00dd2
1669 changed files with 1982740 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
/*!
|
||||
@file ui_UnitBase.cpp
|
||||
@brief UI for UnitBase
|
||||
*/
|
||||
|
||||
#include "ui_UnitBase.hpp"
|
||||
|
||||
UnitUIBase::UnitUIBase(LovyanGFX* parent) : _parent(parent)
|
||||
{
|
||||
_sem = xSemaphoreCreateBinary();
|
||||
xSemaphoreGive(_sem);
|
||||
}
|
||||
|
||||
UnitUIBase::~UnitUIBase()
|
||||
{
|
||||
xSemaphoreTake(_sem, portMAX_DELAY);
|
||||
vSemaphoreDelete(_sem);
|
||||
}
|
||||
|
||||
bool UnitUIBase::lock(portTickType bt)
|
||||
{
|
||||
return xSemaphoreTake(_sem, bt) == pdTRUE;
|
||||
}
|
||||
|
||||
void UnitUIBase::unlock()
|
||||
{
|
||||
xSemaphoreGive(_sem);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue