mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 05:06:30 +04:00
Blocking USB driver API (#2009)
* invalidate memmgt thread dict * Core: rollback memmgt thread dict invalidation * Dialogs: move api lock to toolbox * HAL: blocking usb API * HAL usb: fix api return data * HAL usb: api optimization * api lock: test results * Fix build errors * DAP Link: fix imports * Crash when malloc in ISR * Fix dap-link copypaste error * Moar memory management crashes. * Crash when malloc in IRQ, not ISR * USB-UART: Blocking VCP mode switch Co-authored-by: nminaylov <nm29719@gmail.com> Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "dialogs/dialogs_message.h"
|
||||
#include "dialogs_i.h"
|
||||
#include "dialogs_api_lock.h"
|
||||
#include <toolbox/api_lock.h>
|
||||
#include <assets_icons.h>
|
||||
|
||||
/****************** File browser ******************/
|
||||
@@ -10,7 +10,7 @@ bool dialog_file_browser_show(
|
||||
FuriString* result_path,
|
||||
FuriString* path,
|
||||
const DialogsFileBrowserOptions* options) {
|
||||
FuriApiLock lock = API_LOCK_INIT_LOCKED();
|
||||
FuriApiLock lock = api_lock_alloc_locked();
|
||||
furi_check(lock != NULL);
|
||||
|
||||
DialogsAppData data = {
|
||||
@@ -35,7 +35,7 @@ bool dialog_file_browser_show(
|
||||
|
||||
furi_check(
|
||||
furi_message_queue_put(context->message_queue, &message, FuriWaitForever) == FuriStatusOk);
|
||||
API_LOCK_WAIT_UNTIL_UNLOCK_AND_FREE(lock);
|
||||
api_lock_wait_unlock_and_free(lock);
|
||||
|
||||
return return_data.bool_value;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ bool dialog_file_browser_show(
|
||||
/****************** Message ******************/
|
||||
|
||||
DialogMessageButton dialog_message_show(DialogsApp* context, const DialogMessage* dialog_message) {
|
||||
FuriApiLock lock = API_LOCK_INIT_LOCKED();
|
||||
FuriApiLock lock = api_lock_alloc_locked();
|
||||
furi_check(lock != NULL);
|
||||
|
||||
DialogsAppData data = {
|
||||
@@ -61,7 +61,7 @@ DialogMessageButton dialog_message_show(DialogsApp* context, const DialogMessage
|
||||
|
||||
furi_check(
|
||||
furi_message_queue_put(context->message_queue, &message, FuriWaitForever) == FuriStatusOk);
|
||||
API_LOCK_WAIT_UNTIL_UNLOCK_AND_FREE(lock);
|
||||
api_lock_wait_unlock_and_free(lock);
|
||||
|
||||
return return_data.dialog_value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user