Skip to content

Commit a823efa

Browse files
committed
bugfix: Conflicting declaration error with include<esp_efuse.h>
1 parent 3f61248 commit a823efa

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/lgfx/v1/platforms/esp32/common.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,23 @@ Original Source:
3737

3838
#include <soc/apb_ctrl_reg.h>
3939
#include <soc/efuse_reg.h>
40-
#if __has_include (<esp_efuse_table.h> )
41-
//------------------------------- workaround.
42-
// esp_efuse.h を include したいが、エラーになるバージョンが存在するため、必要な関数宣言のみをここに記述する。;
43-
uint32_t esp_efuse_get_pkg_ver(void);
40+
41+
#if defined (ESP_IDF_VERSION_VAL)
42+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(3, 4, 0)
43+
44+
// include <esp_efuse.h> でエラーが出るバージョンが存在するため、エラー回避用の記述を行ってからincludeする。;
45+
#define _ROM_SECURE_BOOT_H_
46+
#define MAX_KEY_DIGESTS 3
47+
struct ets_secure_boot_key_digests
48+
{
49+
const void *key_digests[MAX_KEY_DIGESTS];
50+
bool allow_key_revoke;
51+
};
52+
typedef struct ets_secure_boot_key_digests ets_secure_boot_key_digests_t;
53+
54+
#include <esp_efuse.h>
55+
#define USE_ESP_EFUSE_GET_PKG_VER
56+
#endif
4457
#endif
4558

4659
#if __has_include(<soc/i2c_periph.h>)
@@ -79,8 +92,7 @@ namespace lgfx
7992

8093
uint32_t get_pkg_ver(void)
8194
{
82-
#if __has_include (<esp_efuse_table.h> )
83-
/// Arduino ESP32 v1.0.5以降はesp_efuse_get_pkg_ver関数が使用できる。 ;
95+
#if defined ( USE_ESP_EFUSE_GET_PKG_VER )
8496
return esp_efuse_get_pkg_ver();
8597
#else
8698
uint32_t pkg_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);

0 commit comments

Comments
 (0)