mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-24 03:33:08 +00:00
4d6b170769
* Fixing compiler warnings with -Wextra * More warnings suppression, WIP * Even more warning fixes * Added new lines at end of text files. * Padding fix * Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline * Fixes for Secplus v1 * -additional warnings * +-Wredundant-decls fixes * FuriHal: print stack overflow task name in console * FuriHal: add missing include Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
#include "dialogs_i.h"
|
|
#include "dialogs_api_lock.h"
|
|
#include "dialogs_module_file_select.h"
|
|
#include "dialogs_module_message.h"
|
|
|
|
static DialogsApp* dialogs_app_alloc() {
|
|
DialogsApp* app = malloc(sizeof(DialogsApp));
|
|
app->message_queue = osMessageQueueNew(8, sizeof(DialogsAppMessage), NULL);
|
|
|
|
return app;
|
|
}
|
|
|
|
static void dialogs_app_process_message(DialogsApp* app, DialogsAppMessage* message) {
|
|
UNUSED(app);
|
|
switch(message->command) {
|
|
case DialogsAppCommandFileOpen:
|
|
message->return_data->bool_value =
|
|
dialogs_app_process_module_file_select(&message->data->file_select);
|
|
break;
|
|
case DialogsAppCommandDialog:
|
|
message->return_data->dialog_value =
|
|
dialogs_app_process_module_message(&message->data->dialog);
|
|
break;
|
|
}
|
|
API_LOCK_UNLOCK(message->lock);
|
|
}
|
|
|
|
int32_t dialogs_srv(void* p) {
|
|
UNUSED(p);
|
|
DialogsApp* app = dialogs_app_alloc();
|
|
furi_record_create("dialogs", app);
|
|
|
|
DialogsAppMessage message;
|
|
while(1) {
|
|
if(osMessageQueueGet(app->message_queue, &message, NULL, osWaitForever) == osOK) {
|
|
dialogs_app_process_message(app, &message);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|