mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-11-25 14:02:28 +03:00
056446dfed
* storage: added global #defines for /int, /ext & /any * storage: introduced PATH_EXT, PATH_INT& PATH_ANY macros * core apps: moved hardcoded config files names to separate headers; prefixed them with "."; updater: added file name migration to new naming convention on backup extraction * storage: fixed storage_merge_recursive handling of complex directory structures; storage_move_to_sd: changed data migration logic to all non-dot files & all folders * core: added macro aliases for core record names * Bumped protobuf commit pointer * storage: reserved 5 pages in /int; denying write&creation of non-dot files when running out of free space Co-authored-by: あく <alleteam@gmail.com>
111 lines
2.8 KiB
C
111 lines
2.8 KiB
C
#pragma once
|
|
#include "stdint.h"
|
|
#include "stdbool.h"
|
|
#include <furi_hal_resources.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define RECORD_NOTIFICATION "notification"
|
|
|
|
typedef struct NotificationApp NotificationApp;
|
|
typedef struct {
|
|
float frequency;
|
|
float volume;
|
|
} NotificationMessageDataSound;
|
|
|
|
typedef struct {
|
|
uint8_t value;
|
|
} NotificationMessageDataLed;
|
|
|
|
typedef struct {
|
|
bool on;
|
|
} NotificationMessageDataVibro;
|
|
|
|
typedef struct {
|
|
uint32_t length;
|
|
} NotificationMessageDataDelay;
|
|
|
|
typedef struct {
|
|
float speaker_volume;
|
|
bool vibro;
|
|
float display_brightness;
|
|
} NotificationMessageDataForcedSettings;
|
|
|
|
typedef struct {
|
|
uint16_t on_time;
|
|
uint16_t period;
|
|
Light color;
|
|
} NotificationMessageDataLedBlink;
|
|
|
|
typedef union {
|
|
NotificationMessageDataSound sound;
|
|
NotificationMessageDataLed led;
|
|
NotificationMessageDataLedBlink led_blink;
|
|
NotificationMessageDataVibro vibro;
|
|
NotificationMessageDataDelay delay;
|
|
NotificationMessageDataForcedSettings forced_settings;
|
|
} NotificationMessageData;
|
|
|
|
typedef enum {
|
|
NotificationMessageTypeVibro,
|
|
|
|
NotificationMessageTypeSoundOn,
|
|
NotificationMessageTypeSoundOff,
|
|
|
|
NotificationMessageTypeLedRed,
|
|
NotificationMessageTypeLedGreen,
|
|
NotificationMessageTypeLedBlue,
|
|
|
|
NotificationMessageTypeLedBlinkStart,
|
|
NotificationMessageTypeLedBlinkStop,
|
|
NotificationMessageTypeLedBlinkColor,
|
|
|
|
NotificationMessageTypeDelay,
|
|
|
|
NotificationMessageTypeLedDisplayBacklight,
|
|
NotificationMessageTypeLedDisplayBacklightEnforceOn,
|
|
NotificationMessageTypeLedDisplayBacklightEnforceAuto,
|
|
|
|
NotificationMessageTypeDoNotReset,
|
|
|
|
NotificationMessageTypeForceSpeakerVolumeSetting,
|
|
NotificationMessageTypeForceVibroSetting,
|
|
NotificationMessageTypeForceDisplayBrightnessSetting,
|
|
|
|
NotificationMessageTypeLedBrightnessSettingApply,
|
|
} NotificationMessageType;
|
|
|
|
typedef struct {
|
|
NotificationMessageType type;
|
|
NotificationMessageData data;
|
|
} NotificationMessage;
|
|
|
|
typedef const NotificationMessage* NotificationSequence[];
|
|
|
|
void notification_message(NotificationApp* app, const NotificationSequence* sequence);
|
|
void notification_message_block(NotificationApp* app, const NotificationSequence* sequence);
|
|
|
|
/**
|
|
* @brief Send internal (apply to permanent layer) notification message. Think twice before use.
|
|
*
|
|
* @param app notification record content
|
|
* @param sequence notification sequence
|
|
*/
|
|
void notification_internal_message(NotificationApp* app, const NotificationSequence* sequence);
|
|
|
|
/**
|
|
* @brief Send internal (apply to permanent layer) notification message and wait for notification end. Think twice before use.
|
|
*
|
|
* @param app notification record content
|
|
* @param sequence notification sequence
|
|
*/
|
|
void notification_internal_message_block(
|
|
NotificationApp* app,
|
|
const NotificationSequence* sequence);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|