-
Notifications
You must be signed in to change notification settings - Fork 518
/
Copy pathplatform_system_flags.h
57 lines (47 loc) · 2.03 KB
/
platform_system_flags.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* File: platform_system_flags.h
* Author: mat
*
* Created on 12 November 2014, 06:24
*/
#ifndef PLATFORM_SYSTEM_FLAGS_H
#define PLATFORM_SYSTEM_FLAGS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "static_assert.h"
typedef struct __attribute__((packed)) platform_system_flags {
uint32_t header;
uint16_t Bootloader_Version_SysFlag;
uint16_t NVMEM_SPARK_Reset_SysFlag;
uint16_t FLASH_OTA_Update_SysFlag;
uint16_t OTA_FLASHED_Status_SysFlag;
uint16_t Factory_Reset_SysFlag;
uint16_t IWDG_Enable_SysFlag;
uint8_t dfu_on_no_firmware; // flag to enable DFU mode when no firmware is available.
/**
* Set to 0x5A to indicate that the bootloader just performed a factory reset.
* The application should clear this flag.
*/
uint8_t Factory_Reset_Done_SysFlag;
/**
* This is a placeholder for when the bootloader can influence how the system module executes.
*/
uint8_t StartupMode_SysFlag;
uint8_t FeaturesEnabled_SysFlag; // default is 0xFF all features enabled. If any bits are cleared in the bottom 4-bits, then the upper 4 bits should be the logical inverse of these.
// This is to prevent against corrupted data causing the bootloader to be unavailable.
uint32_t RCC_CSR_SysFlag;
// bit 0: 1: restore backup ram from flash
// bit 1: 1: session data in flash is stale
uint16_t restore_backup_ram;
uint8_t security_mode_override_value; // If not 0xff, specifies the temporary security mode that overrides the normal mode
uint8_t security_mode_override_reset_count; // Number of system resets after which the normal security mode will be restored
uint32_t security_mode_override_timeout; // Timeout, in seconds, after which the normal security mode will be restored
uint16_t reserved[0];
} platform_system_flags_t;
PARTICLE_STATIC_ASSERT(platform_system_flags_size_changed, sizeof(platform_system_flags_t) == 32);
#ifdef __cplusplus
}
#endif
#endif /* PLATFORM_SYSTEM_FLAGS_H */