1
6
7
8
9
10
14
15
16
17
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* ... */
#ifndef _WL_State_H_
#define _WL_State_H_
#include "esp_err.h"
/* ... */
#if defined(_MSC_VER)
#define ALIGNED_(x) __declspec(align(x))
#else
#if defined(__GNUC__)
#define ALIGNED_(x) __attribute__ ((aligned(x)))
#endif/* ... */
#endif
typedef struct ALIGNED_(32) WL_State_s {
public:
uint32_t wl_dummy_sec_pos;
uint32_t wl_part_max_sec_pos;
uint32_t wl_dummy_sec_move_count;
uint32_t wl_sec_erase_cycle_count;
uint32_t wl_max_sec_erase_cycle_count;
uint32_t wl_block_size;
uint32_t version;
uint32_t wl_device_id;
uint32_t reserved[7];
uint32_t crc32; ...
}{...} wl_state_t;
#ifndef _MSC_VER
static_assert(sizeof(wl_state_t) % 16 == 0, "Size of wl_state_t structure should be compatible with flash encryption");
#endif
#define WL_STATE_CRC_LEN_V1 offsetof(wl_state_t, wl_device_id)
#define WL_STATE_CRC_LEN_V2 offsetof(wl_state_t, crc32)
/* ... */
#endif