unleashed-firmware/applications/dolphin/dolphin_i.h
あく f02cec45a0
[FL-1473, FL-1651] Update STM32CubeWB to latest version. Radio firmware bundle. (#642)
* FuriHal: update STM32CubeWB to latest version.
* Makefile: debug other script
* FuriHal: correctly handle 0 size transfers in VCP
* Dolphin: cleanup and minor timer tuning.
* FuriHal: update FreeRTOS config with bigger timer command queue.
* FuriHal: delayed irq enabling, fixes missing ticks.
* FuriHal: use SFSA to determine free space for internal FS, update linker script to use as much space as theoretically possible.
* Scripts: update core2 flashing scripts and OB data.
* Github: bundle resources, core2 firmware and supplementary data.
* GitHub: versioning for supplemental artifacts
2021-08-17 12:41:08 +03:00

68 lines
1.4 KiB
C

#pragma once
#include "dolphin.h"
#include "dolphin_state.h"
#include "dolphin_views.h"
#include <furi.h>
#include <furi-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>
#define UNLOCK_RST_TIMEOUT 500 // keypress counter reset timeout (ms)
#define HINT_TIMEOUT_L 3 // low refresh rate timeout (app ticks)
#define HINT_TIMEOUT_H 40 // high refresh rate timeout (app ticks)
typedef enum {
DolphinEventTypeDeed,
DolphinEventTypeSave,
DolphinEventTypeTick,
} 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;
// Scene
FuriThread* scene_thread;
// GUI
Gui* gui;
ViewDispatcher* idle_view_dispatcher;
View* idle_view_first_start;
View* idle_view_main;
View* idle_view_dolphin_stats;
View* view_hw_mismatch;
View* view_lockmenu;
ViewPort* lock_viewport;
IconAnimation* lock_icon;
bool locked;
uint8_t lock_count;
uint32_t lock_lastpress;
osTimerId_t timeout_timer;
};
Dolphin* dolphin_alloc();
void dolphin_free(Dolphin* dolphin);
/* Save Dolphin state (write to permanent memory)
* Thread safe
*/
void dolphin_save(Dolphin* dolphin);