#ifndef CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_RBOOT_H_
#define CS_COMMON_PLATFORMS_ESP8266_RBOOT_RBOOT_RBOOT_H_
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_ROMS 4
#define CHKSUM_INIT 0xef
#define SECTOR_SIZE 0x1000
#ifndef BOOT_CONFIG_ADDR
#define BOOT_CONFIG_ADDR 0x1000
#endif
#define BOOT_CONFIG_SECTOR (BOOT_CONFIG_ADDR / SECTOR_SIZE)
#define BOOT_CONFIG_MAGIC 0xe1
#define BOOT_CONFIG_VERSION 0x01
#define MODE_STANDARD 0x00
#define MODE_GPIO_ROM 0x01
typedef struct {
uint8 magic; uint8 version; uint8 mode; uint8 current_rom; uint8 gpio_rom; uint8 count; uint8 previous_rom; uint8 is_first_boot;
uint8 boot_attempts;
uint8 fw_updated;
uint8 padding[2];
uint32 roms[MAX_ROMS]; uint32 roms_sizes[MAX_ROMS]; uint32 fs_addresses[MAX_ROMS]; uint32 fs_sizes[MAX_ROMS]; uint32 user_flags;
#ifdef BOOT_CONFIG_CHKSUM
uint8 chksum; #endif
} rboot_config;
#ifdef __cplusplus
}
#endif
#endif