feat(esp8266): add system version

Bootloader can get the version of application for specific section,
and then check if some features are supported.

Developers can use the macro "ESP_IDF_VERSION" to limite some function like following:

include "esp_idf_version.h"

if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(3, 4, 0) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4, 0, 0) // 3.4 <= ver < 4.0
    do_xxx_process();
endif
This commit is contained in:
dongheng
2019-09-20 14:35:28 +08:00
parent 653d20dddc
commit d0f58daec1
6 changed files with 77 additions and 8 deletions

View File

@ -52,6 +52,16 @@ struct _rtc_sys_info {
if your bootloader is older than v3.2, please don't use this */
};
/**
* @brief System information
*/
typedef struct esp_sys_info {
uint32_t version; //!< system version
uint32_t reserved[3]; //!< reserved data
} esp_sys_info_t;
_Static_assert(sizeof(esp_sys_info_t) == 16, "esp_sys_info_t should be 16 bytes");
extern struct _rtc_sys_info rtc_sys_info;
/**