Skip to content

Commit d59e766

Browse files
committed
Merge branch 'bugfix/fix_compile_warning' into 'master'
Fix compile warning See merge request sdk/ESP8266_RTOS_SDK!363
2 parents 7c46284 + 520b213 commit d59e766

File tree

28 files changed

+99
-70
lines changed

28 files changed

+99
-70
lines changed

components/bootloader/subproject/main/bootloader_start.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414

1515
#include "sdkconfig.h"
1616

17+
#include <string.h>
1718
#include "bootloader_config.h"
1819
#include "bootloader_init.h"
19-
20+
#include "bootloader_utility.h"
2021
#include "esp_image_format.h"
2122
#include "esp_log.h"
2223

components/bootloader_support/src/bootloader_common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,10 @@ bool bootloader_common_erase_part_type_data(const char *list_erase, bool ota_dat
167167

168168
#include "esp_err.h"
169169
#include "esp_log.h"
170+
#include "crc.h"
170171

171172
#include "bootloader_config.h"
172173

173-
static const char* TAG = "boot_comm";
174-
175174
uint32_t bootloader_common_ota_select_crc(const esp_ota_select_entry_t *s)
176175
{
177176
return crc32_le(UINT32_MAX, (uint8_t*)&s->ota_seq, 4);

components/bootloader_support/src/bootloader_flash.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ esp_err_t bootloader_flash_erase_sector(size_t sector)
264264
#include "esp_err.h"
265265
#include "esp_log.h"
266266

267+
extern void Cache_Read_Disable();
268+
extern void Cache_Read_Enable(uint8_t map, uint8_t p, uint8_t v);
269+
267270
static const char *TAG = "bootloader_flash";
268271

269272
typedef enum { SPI_FLASH_RESULT_OK = 0,
@@ -335,7 +338,6 @@ esp_err_t bootloader_flash_read(size_t src_addr, void *dest, size_t size, bool a
335338

336339
esp_err_t bootloader_flash_write(size_t dest_addr, void *src, size_t size, bool write_encrypted)
337340
{
338-
esp_err_t err;
339341
size_t alignment = write_encrypted ? 32 : 4;
340342
if ((dest_addr % alignment) != 0) {
341343
ESP_LOGE(TAG, "bootloader_flash_write dest_addr 0x%x not %d-byte aligned", dest_addr, alignment);

components/bootloader_support/src/bootloader_init.c

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ void __assert_func(const char *file, int line, const char *func, const char *exp
545545

546546
#include "esp_image_format.h"
547547
#include "esp_flash_partitions.h"
548+
#include "bootloader_flash.h"
548549

549550
extern int _bss_start;
550551
extern int _bss_end;
@@ -589,28 +590,28 @@ static esp_err_t bootloader_main()
589590

590591
static void update_flash_config(const esp_image_header_t* pfhdr)
591592
{
592-
uint32_t size;
593-
switch(pfhdr->spi_size) {
594-
case ESP_IMAGE_FLASH_SIZE_1MB:
595-
size = 1;
596-
break;
597-
case ESP_IMAGE_FLASH_SIZE_2MB:
598-
case ESP_IMAGE_FLASH_SIZE_2MB_C1:
599-
size = 2;
600-
break;
601-
case ESP_IMAGE_FLASH_SIZE_4MB:
602-
case ESP_IMAGE_FLASH_SIZE_4MB_C1:
603-
size = 4;
604-
break;
605-
case ESP_IMAGE_FLASH_SIZE_8MB:
606-
size = 8;
607-
break;
608-
case ESP_IMAGE_FLASH_SIZE_16MB:
609-
size = 16;
610-
break;
611-
default:
612-
size = 2;
613-
}
593+
// uint32_t size;
594+
// switch(pfhdr->spi_size) {
595+
// case ESP_IMAGE_FLASH_SIZE_1MB:
596+
// size = 1;
597+
// break;
598+
// case ESP_IMAGE_FLASH_SIZE_2MB:
599+
// case ESP_IMAGE_FLASH_SIZE_2MB_C1:
600+
// size = 2;
601+
// break;
602+
// case ESP_IMAGE_FLASH_SIZE_4MB:
603+
// case ESP_IMAGE_FLASH_SIZE_4MB_C1:
604+
// size = 4;
605+
// break;
606+
// case ESP_IMAGE_FLASH_SIZE_8MB:
607+
// size = 8;
608+
// break;
609+
// case ESP_IMAGE_FLASH_SIZE_16MB:
610+
// size = 16;
611+
// break;
612+
// default:
613+
// size = 2;
614+
// }
614615

615616
// Set flash chip size
616617
// esp_rom_spiflash_config_param(g_rom_flashchip.device_id, size * 0x100000, 0x10000, 0x1000, 0x100, 0xffff);

components/bootloader_support/src/bootloader_utility.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,12 @@ static void set_cache_and_start_app(
482482

483483
#include <stdbool.h>
484484
#include <sys/param.h>
485+
#include <string.h>
485486

486487
#include "bootloader_config.h"
487488
#include "bootloader_utility.h"
489+
#include "bootloader_flash.h"
490+
#include "bootloader_common.h"
488491

489492
#include "esp_err.h"
490493
#include "esp_log.h"
@@ -536,7 +539,7 @@ bool bootloader_utility_load_partition_table(bootloader_state_t* bs)
536539
esp_partition_info_t partiton_local;
537540
esp_partition_info_t *partition = &partiton_local;
538541

539-
memcpy(&partiton_local, (intptr_t)partitions + i * sizeof(esp_partition_info_t), sizeof(esp_partition_info_t));
542+
memcpy(&partiton_local, (void *)((intptr_t)partitions + i * sizeof(esp_partition_info_t)), sizeof(esp_partition_info_t));
540543

541544
ESP_LOGD(TAG, "load partition table entry 0x%x", (intptr_t)partition);
542545
ESP_LOGD(TAG, "type=%x subtype=%x", partition->type, partition->subtype);
@@ -774,6 +777,9 @@ bool bootloader_utility_load_boot_image(const bootloader_state_t *bs, int start_
774777

775778
void bootloader_utility_load_image(const esp_image_metadata_t* image_data)
776779
{
780+
void (*user_start)(size_t start_addr, size_t map);
781+
extern void Cache_Read_Enable(uint8_t map, uint8_t p, uint8_t v);
782+
777783
#if defined(CONFIG_SECURE_BOOT_ENABLED) || defined(CONFIG_FLASH_ENCRYPTION_ENABLED)
778784
esp_err_t err;
779785
#endif
@@ -834,8 +840,6 @@ void bootloader_utility_load_image(const esp_image_metadata_t* image_data)
834840

835841
Cache_Read_Enable(map, 0, 0);
836842

837-
void (*user_start)(size_t start_addr, size_t map);
838-
839843
user_start = (void *)image_data->image.entry_addr;
840844
user_start(image_data->start_addr, map);
841845
#endif /* BOOTLOADER_UNPACK_APP */

components/bootloader_support/src/flash_partitions.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ esp_err_t esp_partition_table_basic_verify(const esp_partition_info_t *partition
9494
#ifdef CONFIG_TARGET_PLATFORM_ESP8266
9595

9696
#include <stdbool.h>
97+
#include <string.h>
9798

9899
#include "bootloader_config.h"
99100

@@ -115,7 +116,7 @@ esp_err_t esp_partition_table_basic_verify(const esp_partition_info_t *partition
115116
esp_partition_info_t part_local;
116117
esp_partition_info_t *part = &part_local;//partition_table[num_parts];
117118

118-
memcpy(&part_local, (intptr_t)partition_table + num_parts * sizeof(esp_partition_info_t), sizeof(esp_partition_info_t));
119+
memcpy(&part_local, (void *)((intptr_t)partition_table + num_parts * sizeof(esp_partition_info_t)), sizeof(esp_partition_info_t));
119120

120121
if (part->magic == ESP_PARTITION_MAGIC) {
121122
const esp_partition_pos_t *pos = &part->pos;

components/esp8266/Makefile.projbuild

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,3 @@ endif
6666

6767
# global CFLAGS for ESP8266
6868
CFLAGS += -DMEMLEAK_DEBUG -DICACHE_FLASH
69-
70-
# void compiler error, we should remove these later
71-
CFLAGS += -Wno-error=char-subscripts -Wno-error=unknown-pragmas -Wno-error=implicit-function-declaration \
72-
-Wno-error=pointer-sign -Wno-error=switch -Wno-error=maybe-uninitialized -Wno-error=format= \
73-
-Wno-error=unused-value -Wno-error=address -Wno-error=return-type -Wno-error=format-extra-args \
74-
-Wno-error=format-zero-length -Wno-error=unused-label -Wno-error=sizeof-pointer-memaccess

components/esp8266/driver/uart.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <stdint.h>
1616
#include <stddef.h>
1717
#include <stdbool.h>
18+
#include <stdio.h>
1819

1920
#include "esp8266/pin_mux_register.h"
2021
#include "esp8266/uart_register.h"

components/freertos/port/esp8266/panic.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "stdlib.h"
16+
1517
#include "esp_attr.h"
1618
#include "esp_libc.h"
1719

1820
#include "esp8266/eagle_soc.h"
21+
#include "esp8266/rom_functions.h"
1922
#include "rom/ets_sys.h"
2023
#include "esp_err.h"
2124

components/lwip/apps/dhcpserver/dhcpserver.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "lwip/pbuf.h"
2828
#include "lwip/udp.h"
2929
#include "lwip/mem.h"
30+
#include "lwip/timeouts.h"
3031
#include "dhcpserver/dhcpserver.h"
3132
#include "dhcpserver/dhcpserver_options.h"
3233

@@ -1154,7 +1155,7 @@ void dhcps_start(struct netif *netif, ip4_addr_t ip)
11541155

11551156
udp_bind(pcb_dhcps, &netif->ip_addr, DHCPS_SERVER_PORT);
11561157
udp_recv(pcb_dhcps, handle_dhcp, NULL);
1157-
sys_timeout(1000, dhcps_coarse_tmr, NULL);
1158+
sys_timeout(1000, (sys_timeout_handler)dhcps_coarse_tmr, NULL);
11581159
#if DHCPS_DEBUG
11591160
DHCPS_LOG("dhcps:dhcps_start->udp_recv function Set a receive callback handle_dhcp for UDP_PCB pcb_dhcps\n");
11601161
#endif
@@ -1176,7 +1177,7 @@ void dhcps_stop(struct netif *netif)
11761177
return;
11771178
}
11781179

1179-
sys_untimeout(dhcps_coarse_tmr, NULL);
1180+
sys_untimeout((sys_timeout_handler)dhcps_coarse_tmr, NULL);
11801181

11811182
if (pcb_dhcps != NULL) {
11821183
udp_disconnect(pcb_dhcps);
@@ -1273,7 +1274,7 @@ void dhcps_coarse_tmr(void)
12731274

12741275
/*Do not restart timer when dhcp server is stopped*/
12751276
if (pcb_dhcps != NULL) {
1276-
sys_timeout(1000, dhcps_coarse_tmr, NULL);
1277+
sys_timeout(1000, (sys_timeout_handler)dhcps_coarse_tmr, NULL);
12771278
}
12781279
}
12791280

0 commit comments

Comments
 (0)