|
|
@@ -10,8 +10,8 @@ bool dialog_file_select_show(
|
|
|
char* result,
|
|
|
uint8_t result_size,
|
|
|
const char* preselected_filename) {
|
|
|
- osSemaphoreId_t semaphore = API_LOCK_INIT_LOCKED();
|
|
|
- furi_check(semaphore != NULL);
|
|
|
+ FuriApiLock lock = API_LOCK_INIT_LOCKED();
|
|
|
+ furi_check(lock != NULL);
|
|
|
|
|
|
DialogsAppData data = {
|
|
|
.file_select = {
|
|
|
@@ -24,14 +24,14 @@ bool dialog_file_select_show(
|
|
|
|
|
|
DialogsAppReturn return_data;
|
|
|
DialogsAppMessage message = {
|
|
|
- .semaphore = semaphore,
|
|
|
+ .lock = lock,
|
|
|
.command = DialogsAppCommandFileOpen,
|
|
|
.data = &data,
|
|
|
.return_data = &return_data,
|
|
|
};
|
|
|
|
|
|
furi_check(osMessageQueuePut(context->message_queue, &message, 0, osWaitForever) == osOK);
|
|
|
- API_LOCK_WAIT_UNTIL_UNLOCK_AND_FREE(semaphore);
|
|
|
+ API_LOCK_WAIT_UNTIL_UNLOCK_AND_FREE(lock);
|
|
|
|
|
|
return return_data.bool_value;
|
|
|
}
|
|
|
@@ -39,8 +39,8 @@ bool dialog_file_select_show(
|
|
|
/****************** Message ******************/
|
|
|
|
|
|
DialogMessageButton dialog_message_show(DialogsApp* context, const DialogMessage* dialog_message) {
|
|
|
- osSemaphoreId_t semaphore = API_LOCK_INIT_LOCKED();
|
|
|
- furi_check(semaphore != NULL);
|
|
|
+ FuriApiLock lock = API_LOCK_INIT_LOCKED();
|
|
|
+ furi_check(lock != NULL);
|
|
|
|
|
|
DialogsAppData data = {
|
|
|
.dialog = {
|
|
|
@@ -49,14 +49,14 @@ DialogMessageButton dialog_message_show(DialogsApp* context, const DialogMessage
|
|
|
|
|
|
DialogsAppReturn return_data;
|
|
|
DialogsAppMessage message = {
|
|
|
- .semaphore = semaphore,
|
|
|
+ .lock = lock,
|
|
|
.command = DialogsAppCommandDialog,
|
|
|
.data = &data,
|
|
|
.return_data = &return_data,
|
|
|
};
|
|
|
|
|
|
furi_check(osMessageQueuePut(context->message_queue, &message, 0, osWaitForever) == osOK);
|
|
|
- API_LOCK_WAIT_UNTIL_UNLOCK_AND_FREE(semaphore);
|
|
|
+ API_LOCK_WAIT_UNTIL_UNLOCK_AND_FREE(lock);
|
|
|
|
|
|
return return_data.dialog_value;
|
|
|
}
|