1
1
/*
2
- * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
2
+ * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
3
3
*
4
4
* SPDX-License-Identifier: Apache-2.0
5
5
*/
6
6
7
7
#include <assert.h>
8
8
#include <sys/param.h>
9
- #include "esp_ota_ops .h"
9
+ #include "esp_app_desc .h"
10
10
#include "esp_attr.h"
11
11
#include "sdkconfig.h"
12
12
13
+
13
14
// Application version info
14
15
const __attribute__((section (".rodata_desc" ))) esp_app_desc_t esp_app_desc = {
15
16
.magic_word = ESP_APP_DESC_MAGIC_WORD ,
@@ -50,7 +51,7 @@ _Static_assert(sizeof(IDF_VER) <= sizeof(esp_app_desc.idf_ver), "IDF_VER is long
50
51
_Static_assert (sizeof (PROJECT_NAME ) <= sizeof (esp_app_desc .project_name ), "PROJECT_NAME is longer than project_name field in structure" );
51
52
#endif
52
53
53
- const esp_app_desc_t * esp_ota_get_app_description (void )
54
+ const esp_app_desc_t * esp_app_get_description (void )
54
55
{
55
56
return & esp_app_desc ;
56
57
}
@@ -64,18 +65,18 @@ static inline char IRAM_ATTR to_hex_digit(unsigned val)
64
65
return (val < 10 ) ? ('0' + val ) : ('a' + val - 10 );
65
66
}
66
67
67
- __attribute__((constructor )) void esp_ota_init_app_elf_sha256 (void )
68
+ __attribute__((constructor )) void esp_init_app_elf_sha256 (void )
68
69
{
69
- esp_ota_get_app_elf_sha256 (NULL , 0 );
70
+ esp_app_get_elf_sha256 (NULL , 0 );
70
71
}
71
72
72
73
/* The esp_app_desc.app_elf_sha256 should be possible to print in panic handler during cache is disabled.
73
74
* But because the cache is disabled the reading esp_app_desc.app_elf_sha256 is not right and
74
75
* can lead to a complete lock-up of the CPU.
75
- * For this reason we do a reading of esp_app_desc.app_elf_sha256 while start up in esp_ota_init_app_elf_sha256 ()
76
+ * For this reason we do a reading of esp_app_desc.app_elf_sha256 while start up in esp_init_app_elf_sha256 ()
76
77
* and keep it in the static s_app_elf_sha256 value.
77
78
*/
78
- int IRAM_ATTR esp_ota_get_app_elf_sha256 (char * dst , size_t size )
79
+ int IRAM_ATTR esp_app_get_elf_sha256 (char * dst , size_t size )
79
80
{
80
81
static char s_app_elf_sha256 [CONFIG_APP_RETRIEVE_LEN_ELF_SHA / 2 ];
81
82
static bool first_call = true;
0 commit comments