unleashed-firmware/applications/dolphin/dolphin_i.h
あく 68a3f6b4b7
[FL-873] Add F5 target, lp5562 driver and api-hal-light (#347)
* Add F5 target, lp5562 driver and api-hal-light. Update api-usage, switch to F5 by default.
* API HAL: add i2c and hardware version api. Dolphin: show hardware version.
* OTP version generator and flashing utility.
* Assets script: fix code formatting
* Backport F5 changes to F4
* F4: disable insomnia, prevent damage to BLE RX path
* F5 HAL API Light: remove magic delay to fix magic BLE
* Dolphin: HW target validation on start
* invert RSSI indication in sub-1
* API HAL: rename board to body in version api
* Gpio tester: detach and release viewport on exit

Co-authored-by: aanper <mail@s3f.ru>
2021-02-18 15:49:32 +03:00

50 lines
957 B
C

#pragma once
#include "dolphin.h"
#include "dolphin_state.h"
#include "dolphin_views.h"
#include <furi.h>
#include <api-hal.h>
#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/canvas.h>
#include <menu/menu.h>
#include <assets_icons.h>
#include <stdint.h>
typedef enum {
DolphinEventTypeDeed,
DolphinEventTypeSave,
} DolphinEventType;
typedef struct {
DolphinEventType type;
union {
DolphinDeed deed;
};
} DolphinEvent;
struct Dolphin {
// Internal message queue
osMessageQueueId_t event_queue;
// State
DolphinState* state;
// Menu
ValueMutex* menu_vm;
// GUI
ViewDispatcher* idle_view_dispatcher;
View* idle_view_first_start;
View* idle_view_main;
View* idle_view_up;
View* idle_view_down;
View* view_hw_mismatch;
};
Dolphin* dolphin_alloc();
/* Save Dolphin state (write to permanent memory)
* Thread safe
*/
void dolphin_save(Dolphin* dolphin);