FlippyPass/project/flippypass.c
2024-08-27 00:37:32 -04:00

39 lines
No EOL
865 B
C

// Libraries
#include <furi.h>
#include "ui.h"
// Entry Point
int32_t flippypass_app(void* p) {
// Not using P Parameter
UNUSED(p);
// Creating the UI struct
uiManager* ui = ui_create();
// Drawwing the UI
InputEvent event;
while(ui->running) {
// Getting the input event
FuriStatus status = furi_message_queue_get(ui->event_queue, &event, 100);
furi_mutex_acquire(ui->mutex, FuriWaitForever);
if (status == FuriStatusOk) {
if (event.key == InputKeyBack) {
ui->running = false;
return 0;
}
} else {
FURI_LOG_D(TAG, "Event Timeout");
}
// Updating canvas
view_port_update(ui->canvas);
furi_mutex_release(ui->mutex);
}
// Cleanup
ui_delete(ui);
// Exit App
return 0;
}