flipperzero-firmware/lib/update_util/update_manifest.h
hedger 4d6b170769
[FL-2520] FW build with -Wextra (#1185)
* Fixing compiler warnings with -Wextra
* More warnings suppression, WIP
* Even more warning fixes
* Added new lines at end of text files.
* Padding fix
* Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline
* Fixes for Secplus v1
* -additional warnings
* +-Wredundant-decls fixes
* FuriHal: print stack overflow task name in console
* FuriHal: add missing include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-05-06 16:37:10 +03:00

63 lines
1.6 KiB
C

#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#include <m-string.h>
#include <furi_hal_flash.h>
/* Paths don't include /ext -- because at startup SD card is mounted as root */
#define UPDATE_DIR_DEFAULT_REL_PATH "/update"
#define UPDATE_MANIFEST_DEFAULT_NAME "update.fuf"
#define UPDATE_MAINFEST_DEFAULT_PATH UPDATE_DIR_DEFAULT_REL_PATH "/" UPDATE_MANIFEST_DEFAULT_NAME
typedef union {
uint8_t raw[6];
struct {
uint8_t major;
uint8_t minor;
uint8_t sub;
uint8_t branch;
uint8_t release;
uint8_t type;
} version;
} UpdateManifestRadioVersion;
_Static_assert(sizeof(UpdateManifestRadioVersion) == 6, "UpdateManifestRadioVersion size error");
typedef struct {
string_t version;
uint32_t target;
string_t staged_loader_file;
uint32_t staged_loader_crc;
string_t firmware_dfu_image;
string_t radio_image;
uint32_t radio_address;
UpdateManifestRadioVersion radio_version;
uint32_t radio_crc;
string_t resource_bundle;
FuriHalFlashRawOptionByteData ob_reference;
FuriHalFlashRawOptionByteData ob_compare_mask;
FuriHalFlashRawOptionByteData ob_write_mask;
bool valid;
} UpdateManifest;
UpdateManifest* update_manifest_alloc();
void update_manifest_free(UpdateManifest* update_manifest);
bool update_manifest_init(UpdateManifest* update_manifest, const char* manifest_filename);
bool update_manifest_init_mem(
UpdateManifest* update_manifest,
const uint8_t* manifest_data,
const uint16_t length);
bool update_manifest_has_obdata(UpdateManifest* update_manifest);
#ifdef __cplusplus
}
#endif