Lockable renamed to Lock (#219)
Also changed usage from unique_ptr to class value.
This commit is contained in:
committed by
GitHub
parent
2e86d4774b
commit
55bfb9fe3b
@@ -32,8 +32,8 @@ std::string State::getSelectedChildPath() const {
|
||||
}
|
||||
|
||||
bool State::setEntriesForPath(const std::string& path) {
|
||||
auto scoped_lock = mutex.scoped();
|
||||
if (!scoped_lock->lock(100)) {
|
||||
auto lock = mutex.asScopedLock();
|
||||
if (!lock.lock(100)) {
|
||||
TT_LOG_E(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, "setEntriesForPath");
|
||||
return false;
|
||||
}
|
||||
@@ -102,8 +102,8 @@ bool State::setEntriesForChildPath(const std::string& child_path) {
|
||||
}
|
||||
|
||||
bool State::getDirent(uint32_t index, dirent& dirent) {
|
||||
auto scoped_mutex = mutex.scoped();
|
||||
if (!scoped_mutex->lock(50 / portTICK_PERIOD_MS)) {
|
||||
auto lock = mutex.asScopedLock();
|
||||
if (!lock.lock(50 / portTICK_PERIOD_MS)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ void View::showActionsForFile() {
|
||||
}
|
||||
|
||||
void View::update() {
|
||||
auto scoped_lockable = lvgl::getLvglSyncLockable()->scoped();
|
||||
auto scoped_lockable = lvgl::getLvglSyncLock()->scoped();
|
||||
if (scoped_lockable->lock(100 / portTICK_PERIOD_MS)) {
|
||||
lv_obj_clean(dir_entry_list);
|
||||
|
||||
@@ -277,14 +277,14 @@ void View::init(lv_obj_t* parent) {
|
||||
}
|
||||
|
||||
void View::onDirEntryListScrollBegin() {
|
||||
auto scoped_lockable = lvgl::getLvglSyncLockable()->scoped();
|
||||
auto scoped_lockable = lvgl::getLvglSyncLock()->scoped();
|
||||
if (scoped_lockable->lock(100 / portTICK_PERIOD_MS)) {
|
||||
lv_obj_add_flag(action_list, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
}
|
||||
|
||||
void View::onNavigate() {
|
||||
auto scoped_lockable = lvgl::getLvglSyncLockable()->scoped();
|
||||
auto scoped_lockable = lvgl::getLvglSyncLock()->scoped();
|
||||
if (scoped_lockable->lock(100 / portTICK_PERIOD_MS)) {
|
||||
lv_obj_add_flag(action_list, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ void GpioApp::updatePinStates() {
|
||||
}
|
||||
|
||||
void GpioApp::updatePinWidgets() {
|
||||
auto scoped_lvgl_lock = lvgl::getLvglSyncLockable()->scoped();
|
||||
auto scoped_gpio_lock = mutex.scoped();
|
||||
if (scoped_gpio_lock->lock() && scoped_lvgl_lock->lock(100)) {
|
||||
auto scoped_lvgl_lock = lvgl::getLvglSyncLock()->scoped();
|
||||
auto scoped_gpio_lock = mutex.asScopedLock();
|
||||
if (scoped_gpio_lock.lock() && scoped_lvgl_lock->lock(100)) {
|
||||
for (int j = 0; j < GPIO_NUM_MAX; ++j) {
|
||||
int level = pinStates[j];
|
||||
lv_obj_t* label = lvPins[j];
|
||||
|
||||
@@ -90,7 +90,7 @@ ScreenshotApp::~ScreenshotApp() {
|
||||
}
|
||||
|
||||
void ScreenshotApp::onTimerTick() {
|
||||
auto lvgl_lock = lvgl::getLvglSyncLockable()->scoped();
|
||||
auto lvgl_lock = lvgl::getLvglSyncLock()->scoped();
|
||||
if (lvgl_lock->lock(50 / portTICK_PERIOD_MS)) {
|
||||
updateScreenshotMode();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user