mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 15:28:36 -07:00
Temporarily backport app updates from apps repo
This commit is contained in:
52
applications/external/mayhem_qrcode/uart_echo.h
vendored
Normal file
52
applications/external/mayhem_qrcode/uart_echo.h
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <gui/gui.h>
|
||||
#include <notification/notification.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <gui/elements.h>
|
||||
#include <furi_hal_uart.h>
|
||||
#include <furi_hal_console.h>
|
||||
#include <gui/view_dispatcher.h>
|
||||
#include <gui/modules/dialog_ex.h>
|
||||
|
||||
#define LINES_ON_SCREEN 6
|
||||
#define COLUMNS_ON_SCREEN 21
|
||||
|
||||
typedef struct UartDumpModel UartDumpModel;
|
||||
|
||||
typedef struct {
|
||||
Gui* gui;
|
||||
NotificationApp* notification;
|
||||
ViewDispatcher* view_dispatcher;
|
||||
View* view;
|
||||
FuriThread* worker_thread;
|
||||
FuriStreamBuffer* rx_stream;
|
||||
bool initialized;
|
||||
} UartEchoApp;
|
||||
|
||||
typedef struct {
|
||||
FuriString* text;
|
||||
} ListElement;
|
||||
|
||||
struct UartDumpModel {
|
||||
ListElement* list[LINES_ON_SCREEN];
|
||||
uint8_t line;
|
||||
|
||||
char last_char;
|
||||
bool escape;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
WorkerEventReserved = (1 << 0), // Reserved for StreamBuffer internal event
|
||||
WorkerEventStop = (1 << 1),
|
||||
WorkerEventRx = (1 << 2),
|
||||
} WorkerEventFlags;
|
||||
|
||||
#define WORKER_EVENTS_MASK (WorkerEventStop | WorkerEventRx)
|
||||
|
||||
const NotificationSequence sequence_notification = {
|
||||
&message_display_backlight_on,
|
||||
&message_green_255,
|
||||
&message_delay_10,
|
||||
NULL,
|
||||
};
|
||||
Reference in New Issue
Block a user