This repository has been archived on 2026-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
FlippyPass/project/flippypass.c

39 lines
865 B
C
Raw Normal View History

2024-08-11 21:23:09 -05:00
// Libraries
#include <furi.h>
2024-08-26 04:20:00 -05:00
#include "ui.h"
2024-08-11 21:23:09 -05:00
// Entry Point
int32_t flippypass_app(void* p) {
// Not using P Parameter
UNUSED(p);
2024-08-26 04:20:00 -05:00
// Creating the UI struct
uiManager* ui = ui_create();
// Drawwing the UI
2024-08-26 23:37:32 -05:00
InputEvent event;
2024-08-26 04:20:00 -05:00
while(ui->running) {
2024-08-26 23:37:32 -05:00
// 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");
}
2024-08-26 04:20:00 -05:00
// Updating canvas
view_port_update(ui->canvas);
2024-08-26 23:37:32 -05:00
furi_mutex_release(ui->mutex);
2024-08-26 04:20:00 -05:00
}
2024-08-26 23:37:32 -05:00
// Cleanup
ui_delete(ui);
2024-08-11 21:23:09 -05:00
// Exit App
return 0;
}