diff --git a/components/bootloader/subproject/main/bootloader_start.c b/components/bootloader/subproject/main/bootloader_start.c index 75d3744f..b5c68ea3 100644 --- a/components/bootloader/subproject/main/bootloader_start.c +++ b/components/bootloader/subproject/main/bootloader_start.c @@ -14,9 +14,10 @@ #include "sdkconfig.h" +#include #include "bootloader_config.h" #include "bootloader_init.h" - +#include "bootloader_utility.h" #include "esp_image_format.h" #include "esp_log.h" diff --git a/components/bootloader_support/src/bootloader_common.c b/components/bootloader_support/src/bootloader_common.c index c85085f8..1772a978 100644 --- a/components/bootloader_support/src/bootloader_common.c +++ b/components/bootloader_support/src/bootloader_common.c @@ -167,11 +167,10 @@ bool bootloader_common_erase_part_type_data(const char *list_erase, bool ota_dat #include "esp_err.h" #include "esp_log.h" +#include "crc.h" #include "bootloader_config.h" -static const char* TAG = "boot_comm"; - uint32_t bootloader_common_ota_select_crc(const esp_ota_select_entry_t *s) { return crc32_le(UINT32_MAX, (uint8_t*)&s->ota_seq, 4); diff --git a/components/bootloader_support/src/bootloader_flash.c b/components/bootloader_support/src/bootloader_flash.c index c1a43825..bb835cdc 100644 --- a/components/bootloader_support/src/bootloader_flash.c +++ b/components/bootloader_support/src/bootloader_flash.c @@ -264,6 +264,9 @@ esp_err_t bootloader_flash_erase_sector(size_t sector) #include "esp_err.h" #include "esp_log.h" +extern void Cache_Read_Disable(); +extern void Cache_Read_Enable(uint8_t map, uint8_t p, uint8_t v); + static const char *TAG = "bootloader_flash"; 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 esp_err_t bootloader_flash_write(size_t dest_addr, void *src, size_t size, bool write_encrypted) { - esp_err_t err; size_t alignment = write_encrypted ? 32 : 4; if ((dest_addr % alignment) != 0) { ESP_LOGE(TAG, "bootloader_flash_write dest_addr 0x%x not %d-byte aligned", dest_addr, alignment); diff --git a/components/bootloader_support/src/bootloader_init.c b/components/bootloader_support/src/bootloader_init.c index c867be74..c876f0f4 100644 --- a/components/bootloader_support/src/bootloader_init.c +++ b/components/bootloader_support/src/bootloader_init.c @@ -545,6 +545,7 @@ void __assert_func(const char *file, int line, const char *func, const char *exp #include "esp_image_format.h" #include "esp_flash_partitions.h" +#include "bootloader_flash.h" extern int _bss_start; extern int _bss_end; @@ -589,28 +590,28 @@ static esp_err_t bootloader_main() static void update_flash_config(const esp_image_header_t* pfhdr) { - uint32_t size; - switch(pfhdr->spi_size) { - case ESP_IMAGE_FLASH_SIZE_1MB: - size = 1; - break; - case ESP_IMAGE_FLASH_SIZE_2MB: - case ESP_IMAGE_FLASH_SIZE_2MB_C1: - size = 2; - break; - case ESP_IMAGE_FLASH_SIZE_4MB: - case ESP_IMAGE_FLASH_SIZE_4MB_C1: - size = 4; - break; - case ESP_IMAGE_FLASH_SIZE_8MB: - size = 8; - break; - case ESP_IMAGE_FLASH_SIZE_16MB: - size = 16; - break; - default: - size = 2; - } + // uint32_t size; + // switch(pfhdr->spi_size) { + // case ESP_IMAGE_FLASH_SIZE_1MB: + // size = 1; + // break; + // case ESP_IMAGE_FLASH_SIZE_2MB: + // case ESP_IMAGE_FLASH_SIZE_2MB_C1: + // size = 2; + // break; + // case ESP_IMAGE_FLASH_SIZE_4MB: + // case ESP_IMAGE_FLASH_SIZE_4MB_C1: + // size = 4; + // break; + // case ESP_IMAGE_FLASH_SIZE_8MB: + // size = 8; + // break; + // case ESP_IMAGE_FLASH_SIZE_16MB: + // size = 16; + // break; + // default: + // size = 2; + // } // Set flash chip size // esp_rom_spiflash_config_param(g_rom_flashchip.device_id, size * 0x100000, 0x10000, 0x1000, 0x100, 0xffff); diff --git a/components/bootloader_support/src/bootloader_utility.c b/components/bootloader_support/src/bootloader_utility.c index b7d2b359..a1b4b2de 100644 --- a/components/bootloader_support/src/bootloader_utility.c +++ b/components/bootloader_support/src/bootloader_utility.c @@ -482,9 +482,12 @@ static void set_cache_and_start_app( #include #include +#include #include "bootloader_config.h" #include "bootloader_utility.h" +#include "bootloader_flash.h" +#include "bootloader_common.h" #include "esp_err.h" #include "esp_log.h" @@ -536,7 +539,7 @@ bool bootloader_utility_load_partition_table(bootloader_state_t* bs) esp_partition_info_t partiton_local; esp_partition_info_t *partition = &partiton_local; - memcpy(&partiton_local, (intptr_t)partitions + i * sizeof(esp_partition_info_t), sizeof(esp_partition_info_t)); + memcpy(&partiton_local, (void *)((intptr_t)partitions + i * sizeof(esp_partition_info_t)), sizeof(esp_partition_info_t)); ESP_LOGD(TAG, "load partition table entry 0x%x", (intptr_t)partition); 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_ void bootloader_utility_load_image(const esp_image_metadata_t* image_data) { + void (*user_start)(size_t start_addr, size_t map); + extern void Cache_Read_Enable(uint8_t map, uint8_t p, uint8_t v); + #if defined(CONFIG_SECURE_BOOT_ENABLED) || defined(CONFIG_FLASH_ENCRYPTION_ENABLED) esp_err_t err; #endif @@ -834,8 +840,6 @@ void bootloader_utility_load_image(const esp_image_metadata_t* image_data) Cache_Read_Enable(map, 0, 0); - void (*user_start)(size_t start_addr, size_t map); - user_start = (void *)image_data->image.entry_addr; user_start(image_data->start_addr, map); #endif /* BOOTLOADER_UNPACK_APP */ diff --git a/components/bootloader_support/src/flash_partitions.c b/components/bootloader_support/src/flash_partitions.c index 2e450ac0..f258ca64 100644 --- a/components/bootloader_support/src/flash_partitions.c +++ b/components/bootloader_support/src/flash_partitions.c @@ -94,6 +94,7 @@ esp_err_t esp_partition_table_basic_verify(const esp_partition_info_t *partition #ifdef CONFIG_TARGET_PLATFORM_ESP8266 #include +#include #include "bootloader_config.h" @@ -115,7 +116,7 @@ esp_err_t esp_partition_table_basic_verify(const esp_partition_info_t *partition esp_partition_info_t part_local; esp_partition_info_t *part = &part_local;//partition_table[num_parts]; - memcpy(&part_local, (intptr_t)partition_table + num_parts * sizeof(esp_partition_info_t), sizeof(esp_partition_info_t)); + memcpy(&part_local, (void *)((intptr_t)partition_table + num_parts * sizeof(esp_partition_info_t)), sizeof(esp_partition_info_t)); if (part->magic == ESP_PARTITION_MAGIC) { const esp_partition_pos_t *pos = &part->pos; diff --git a/components/esp8266/Makefile.projbuild b/components/esp8266/Makefile.projbuild index e8bf4bdf..cdc8067e 100644 --- a/components/esp8266/Makefile.projbuild +++ b/components/esp8266/Makefile.projbuild @@ -66,9 +66,3 @@ endif # global CFLAGS for ESP8266 CFLAGS += -DMEMLEAK_DEBUG -DICACHE_FLASH - -# void compiler error, we should remove these later -CFLAGS += -Wno-error=char-subscripts -Wno-error=unknown-pragmas -Wno-error=implicit-function-declaration \ - -Wno-error=pointer-sign -Wno-error=switch -Wno-error=maybe-uninitialized -Wno-error=format= \ - -Wno-error=unused-value -Wno-error=address -Wno-error=return-type -Wno-error=format-extra-args \ - -Wno-error=format-zero-length -Wno-error=unused-label -Wno-error=sizeof-pointer-memaccess diff --git a/components/esp8266/driver/uart.c b/components/esp8266/driver/uart.c index 269940b2..f4b4f333 100644 --- a/components/esp8266/driver/uart.c +++ b/components/esp8266/driver/uart.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "esp8266/pin_mux_register.h" #include "esp8266/uart_register.h" diff --git a/components/freertos/port/esp8266/panic.c b/components/freertos/port/esp8266/panic.c index 6e2614af..57719aea 100644 --- a/components/freertos/port/esp8266/panic.c +++ b/components/freertos/port/esp8266/panic.c @@ -12,10 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "stdlib.h" + #include "esp_attr.h" #include "esp_libc.h" #include "esp8266/eagle_soc.h" +#include "esp8266/rom_functions.h" #include "rom/ets_sys.h" #include "esp_err.h" diff --git a/components/lwip/apps/dhcpserver/dhcpserver.c b/components/lwip/apps/dhcpserver/dhcpserver.c index dc0f2886..be20ea86 100644 --- a/components/lwip/apps/dhcpserver/dhcpserver.c +++ b/components/lwip/apps/dhcpserver/dhcpserver.c @@ -27,6 +27,7 @@ #include "lwip/pbuf.h" #include "lwip/udp.h" #include "lwip/mem.h" +#include "lwip/timeouts.h" #include "dhcpserver/dhcpserver.h" #include "dhcpserver/dhcpserver_options.h" @@ -1154,7 +1155,7 @@ void dhcps_start(struct netif *netif, ip4_addr_t ip) udp_bind(pcb_dhcps, &netif->ip_addr, DHCPS_SERVER_PORT); udp_recv(pcb_dhcps, handle_dhcp, NULL); - sys_timeout(1000, dhcps_coarse_tmr, NULL); + sys_timeout(1000, (sys_timeout_handler)dhcps_coarse_tmr, NULL); #if DHCPS_DEBUG DHCPS_LOG("dhcps:dhcps_start->udp_recv function Set a receive callback handle_dhcp for UDP_PCB pcb_dhcps\n"); #endif @@ -1176,7 +1177,7 @@ void dhcps_stop(struct netif *netif) return; } - sys_untimeout(dhcps_coarse_tmr, NULL); + sys_untimeout((sys_timeout_handler)dhcps_coarse_tmr, NULL); if (pcb_dhcps != NULL) { udp_disconnect(pcb_dhcps); @@ -1273,7 +1274,7 @@ void dhcps_coarse_tmr(void) /*Do not restart timer when dhcp server is stopped*/ if (pcb_dhcps != NULL) { - sys_timeout(1000, dhcps_coarse_tmr, NULL); + sys_timeout(1000, (sys_timeout_handler)dhcps_coarse_tmr, NULL); } } diff --git a/components/lwip/component.mk b/components/lwip/component.mk index 6d0265b3..96de04b3 100644 --- a/components/lwip/component.mk +++ b/components/lwip/component.mk @@ -20,6 +20,7 @@ COMPONENT_SRCDIRS += apps/dhcpserver \ CFLAGS += -Wno-address #lots of LWIP source files evaluate macros that check address of stack variables lwip/src/apps/sntp/sntp.o: CFLAGS += -Wno-implicit-function-declaration +lwip/src/core/ipv4/ip4.o: CFLAGS += -Wno-implicit-function-declaration ifdef CONFIG_LWIP_SOCKET_MULTITHREAD COMPONENT_OBJEXCLUDE := lwip/src/api/sockets.o diff --git a/components/lwip/port/esp8266/include/lwipopts.h b/components/lwip/port/esp8266/include/lwipopts.h index aaa9c1f3..e9c8b14e 100644 --- a/components/lwip/port/esp8266/include/lwipopts.h +++ b/components/lwip/port/esp8266/include/lwipopts.h @@ -1900,7 +1900,7 @@ void *memp_malloc_ll(size_t type); --------------------------------------- */ -#define LWIP_HOOK_IP4_ROUTE_SRC ip4_route_src_hook +#define LWIP_HOOK_IP4_ROUTE_SRC(d, s) (void *)ip4_route_src_hook(d, s) /** * @defgroup lwip_opts_hooks Hooks diff --git a/components/ssl/axtls/include/ssl/ssl_os_port.h b/components/ssl/axtls/include/ssl/ssl_os_port.h index 84d350d3..2626b8c5 100644 --- a/components/ssl/axtls/include/ssl/ssl_os_port.h +++ b/components/ssl/axtls/include/ssl/ssl_os_port.h @@ -42,6 +42,12 @@ extern "C" { #endif #include +#include +#include +#include +#include + +#include "rom/ets_sys.h" #if 0 #define ssl_printf(fmt, args...) printf(fmt,## args) @@ -49,6 +55,10 @@ extern "C" { #define ssl_printf(fmt, args...) #endif +void *zalloc(size_t n); +uint32_t system_get_data_of_array_8(const uint8_t*, uint8_t); +void system_get_string_from_flash(const char *, char *, size_t n); + #define STDCALL #define EXP_FUNC @@ -89,11 +99,11 @@ static __inline__ uint64_t be64toh(uint64_t __x) {return (((uint64_t)be32toh(__x #endif #ifdef MEMLEAK_DEBUG -#define SSL_MALLOC(size) ax_malloc(size, __FILE__, __LINE__) -#define SSL_REALLOC(mem_ref,size) ax_realloc(mem_ref, size, __FILE__, __LINE__) -#define SSL_CALLOC(element, size) ax_calloc(element, size, __FILE__, __LINE__) -#define SSL_ZALLOC(size) ax_zalloc(size, __FILE__, __LINE__) -#define SSL_FREE(mem_ref) ax_free(mem_ref, __FILE__, __LINE__) +#define SSL_MALLOC(size) os_malloc(size) +#define SSL_REALLOC(mem_ref,size) os_realloc(mem_ref, size) +#define SSL_CALLOC(element, size) os_calloc(element, size) +#define SSL_ZALLOC(size) os_zalloc(size) +#define SSL_FREE(mem_ref) os_free(mem_ref) #else #define SSL_MALLOC(size) malloc(size) #define SSL_REALLOC(mem_ref,size) realloc(mem_ref, size) diff --git a/components/ssl/axtls/source/crypto/ssl_crypto_misc.c b/components/ssl/axtls/source/crypto/ssl_crypto_misc.c index 1bcb1a1e..a933af19 100644 --- a/components/ssl/axtls/source/crypto/ssl_crypto_misc.c +++ b/components/ssl/axtls/source/crypto/ssl_crypto_misc.c @@ -266,6 +266,7 @@ int get_random_NZ(int num_rand_bytes, uint8_t *rand_data) int hex_finish; int hex_index; +#if 0 static void print_hex_init(int finish) { hex_finish = finish; @@ -297,6 +298,7 @@ static void print_hex(uint8_t hex) ssl_printf("\n"); } } +#endif /** * Spit out a blob of data for diagnostics. The data is is a nice column format @@ -402,8 +404,9 @@ EXP_FUNC int STDCALL base64_decode(const char *in, int len, error: #ifdef CONFIG_SSL_FULL_MODE - if (ret < 0) + if (ret < 0) { ssl_printf("Error: Invalid base64\n"); //TTY_FLUSH(); + } #endif //TTY_FLUSH(); SSL_FREE(base64_map); diff --git a/components/ssl/axtls/source/ssl/ssl_loader.c b/components/ssl/axtls/source/ssl/ssl_loader.c index 135536e8..6b0d56de 100644 --- a/components/ssl/axtls/source/ssl/ssl_loader.c +++ b/components/ssl/axtls/source/ssl/ssl_loader.c @@ -224,6 +224,8 @@ static int pem_decrypt(const char *where, const char *end, MD5_CTX md5_ctx; AES_CTX aes_ctx; uint8_t key[32]; /* AES256 size */ + char *aes_str_0_ram = NULL; + char *aes_str_1_ram = NULL; if (password == NULL || strlen(password) == 0) { @@ -233,8 +235,8 @@ static int pem_decrypt(const char *where, const char *end, goto error; } - char *aes_str_0_ram = (char *)SSL_MALLOC(24); - char *aes_str_1_ram = (char *)SSL_MALLOC(24); + aes_str_0_ram = (char *)SSL_MALLOC(24); + aes_str_1_ram = (char *)SSL_MALLOC(24); system_get_string_from_flash(aes_str[0], aes_str_0_ram, 24); system_get_string_from_flash(aes_str[1], aes_str_1_ram, 24); diff --git a/components/ssl/axtls/source/ssl/ssl_os_port.c b/components/ssl/axtls/source/ssl/ssl_os_port.c index a8a96a44..fbc37d35 100644 --- a/components/ssl/axtls/source/ssl/ssl_os_port.c +++ b/components/ssl/axtls/source/ssl/ssl_os_port.c @@ -88,14 +88,14 @@ EXP_FUNC int STDCALL getdomainname(char *buf, int buf_size) } #endif -static const char * out_of_mem_str = "out of memory %s %d\n"; +//static const char * out_of_mem_str = "out of memory %s %d\n"; #define exit_now printf //#define SSL_LOG #ifdef SSL_LOG #define debug_now printf #else -#define debug_now +#define debug_now(fmt, ...) #endif #if 0 diff --git a/components/ssl/axtls/source/ssl/ssl_platform.c b/components/ssl/axtls/source/ssl/ssl_platform.c index 9f4f4e35..0ca2ef48 100644 --- a/components/ssl/axtls/source/ssl/ssl_platform.c +++ b/components/ssl/axtls/source/ssl/ssl_platform.c @@ -184,6 +184,8 @@ EXP_FUNC int STDCALL esp_base64_encode(uint8_t *dst, size_t dlen, size_t *olen, return 0; } + + return 0; } static char *key_password = NULL; @@ -1098,11 +1100,11 @@ void esp_ssl_sleep(uint16_t mseconds) vTaskDelay(mseconds / portTICK_RATE_MS); } -esp_ssl_CTX_set_client_cert_cb(){} +void esp_ssl_CTX_set_client_cert_cb(){} -esp_ssl_CTX_set_mode(){} +void esp_ssl_CTX_set_mode(){} -esp_ssl_pending() +void esp_ssl_pending() { } diff --git a/components/ssl/axtls/source/ssl/ssl_tls1_svr.c b/components/ssl/axtls/source/ssl/ssl_tls1_svr.c index 090e829a..253431cd 100644 --- a/components/ssl/axtls/source/ssl/ssl_tls1_svr.c +++ b/components/ssl/axtls/source/ssl/ssl_tls1_svr.c @@ -54,8 +54,9 @@ EXP_FUNC SSL * STDCALL ssl_server_new(SSL_CTX *ssl_ctx, int client_fd) ssl->next_state = HS_CLIENT_HELLO; #ifdef CONFIG_SSL_FULL_MODE - if (ssl_ctx->chain_length == 0) + if (ssl_ctx->chain_length == 0) { ssl_printf("Warning - no server certificate defined\n"); //TTY_FLUSH(); + } #endif return ssl; diff --git a/components/ssl/axtls/source/ssl/ssl_x509.c b/components/ssl/axtls/source/ssl/ssl_x509.c index 861e5388..0e4fd656 100644 --- a/components/ssl/axtls/source/ssl/ssl_x509.c +++ b/components/ssl/axtls/source/ssl/ssl_x509.c @@ -491,7 +491,7 @@ end_verify: /** * Used for diagnostics. */ -static const char *not_part_of_cert = ""; +//static const char *not_part_of_cert = ""; void x509_print(const X509_CTX *cert, CA_CERT_CTX *ca_cert_ctx) { if (cert == NULL) diff --git a/examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c b/examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c index 380906bb..f78774bc 100644 --- a/examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c +++ b/examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c @@ -280,7 +280,7 @@ void aws_iot_task(void *param) { continue; } - ESP_LOGI(TAG, "Stack remaining for task '%s' is %d bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL)); + ESP_LOGI(TAG, "Stack remaining for task '%s' is %lu bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL)); vTaskDelay(1000 / portTICK_RATE_MS); sprintf(cPayload, "%s : %d ", "hello from ESP32 (QOS0)", i++); paramsQOS0.payloadLen = strlen(cPayload); diff --git a/examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c b/examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c index 9720e3b3..48a5d3cf 100644 --- a/examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c +++ b/examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c @@ -316,7 +316,7 @@ void aws_iot_task(void *param) { } } ESP_LOGI(TAG, "*****************************************************************************************"); - ESP_LOGI(TAG, "Stack remaining for task '%s' is %d bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL)); + ESP_LOGI(TAG, "Stack remaining for task '%s' is %lu bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL)); vTaskDelay(1000 / portTICK_RATE_MS); } diff --git a/examples/storage/spiffs_test/main/component.mk b/examples/storage/spiffs_test/main/component.mk index a98f634e..d1e24a8e 100644 --- a/examples/storage/spiffs_test/main/component.mk +++ b/examples/storage/spiffs_test/main/component.mk @@ -2,3 +2,8 @@ # "main" pseudo-component makefile. # # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) + +CFLAGS += -Wno-error=implicit-function-declaration \ + -Wno-error=unused-label \ + -Wno-implicit-function-declaration \ + -Wno-unused-label diff --git a/examples/storage/spiffs_test/main/test_bugreports.c b/examples/storage/spiffs_test/main/test_bugreports.c index 6d86237a..a2a1ea04 100644 --- a/examples/storage/spiffs_test/main/test_bugreports.c +++ b/examples/storage/spiffs_test/main/test_bugreports.c @@ -191,7 +191,6 @@ TEST(nodemcu_309) { fd = SPIFFS_open(FS, fname, SPIFFS_RDWR | SPIFFS_CREAT | SPIFFS_TRUNC | SPIFFS_DIRECT, 0); TEST_CHECK(fd > 0); int i; - spiffs_stat s; res = SPIFFS_OK; u8_t err = 0; for (i = 1; i <= 1280; i++) { @@ -244,7 +243,6 @@ TEST(robert) { sprintf(fname, "test.txt"); fd = SPIFFS_open(FS, fname, SPIFFS_RDWR | SPIFFS_CREAT | SPIFFS_TRUNC, 0); TEST_CHECK(fd > 0); - int i; res = SPIFFS_OK; char buf[500]; memset(buf, 0xaa, 500); diff --git a/examples/storage/spiffs_test/main/test_hydrogen.c b/examples/storage/spiffs_test/main/test_hydrogen.c index 5902a38e..d5957d75 100644 --- a/examples/storage/spiffs_test/main/test_hydrogen.c +++ b/examples/storage/spiffs_test/main/test_hydrogen.c @@ -233,7 +233,7 @@ TEST(list_dir) while ((pe = SPIFFS_readdir(&d, pe))) { printf(" %s [%04x] size:%i\n", pe->name, pe->obj_id, pe->size); for (i = 0; i < file_cnt; i++) { - if (strcmp(files[i], pe->name) == 0) { + if (strcmp(files[i], (char *)pe->name) == 0) { found++; break; } @@ -276,7 +276,7 @@ TEST(open_by_dirent) { while ((pe = SPIFFS_readdir(&d, pe))) { spiffs_file fd = SPIFFS_open_by_dirent(FS, pe, SPIFFS_RDWR, 0); TEST_CHECK(fd >= 0); - res = read_and_verify_fd(fd, pe->name); + res = read_and_verify_fd(fd, (char *)pe->name); TEST_CHECK(res == SPIFFS_OK); fd = SPIFFS_open_by_dirent(FS, pe, SPIFFS_RDWR, 0); TEST_CHECK(fd >= 0); @@ -872,7 +872,6 @@ TEST(lseek_simple_modification) { int res; spiffs_file fd; char *fname = "seekfile"; - int i; int len = 4096; fd = SPIFFS_open(FS, fname, SPIFFS_TRUNC | SPIFFS_CREAT | SPIFFS_RDWR, 0); TEST_CHECK(fd > 0); @@ -914,7 +913,6 @@ TEST(lseek_modification_append) { int res; spiffs_file fd; char *fname = "seekfile"; - int i; int len = 4096; fd = SPIFFS_open(FS, fname, SPIFFS_TRUNC | SPIFFS_CREAT | SPIFFS_RDWR, 0); TEST_CHECK(fd > 0); diff --git a/examples/storage/spiffs_test/main/test_main.c b/examples/storage/spiffs_test/main/test_main.c index b0081bcb..bf14c8b4 100644 --- a/examples/storage/spiffs_test/main/test_main.c +++ b/examples/storage/spiffs_test/main/test_main.c @@ -63,7 +63,7 @@ void spiffs_fs1_init(void) esp_spiffs_init(&config); } -void user_init(void) +void app_main(void) { spiffs_fs1_init(); diff --git a/examples/storage/spiffs_test/main/test_spiffs.c b/examples/storage/spiffs_test/main/test_spiffs.c index f8519876..45aefee7 100644 --- a/examples/storage/spiffs_test/main/test_spiffs.c +++ b/examples/storage/spiffs_test/main/test_spiffs.c @@ -170,7 +170,6 @@ static s32_t _read(u32_t addr, u32_t size, u8_t *dst) { } static s32_t _write(u32_t addr, u32_t size, u8_t *src) { - int i; //printf("wr %08x %i\n", addr, size); if (log_flash_ops) { bytes_wr += size; @@ -375,7 +374,7 @@ void dump_flash_access_stats() { } -static u32_t old_perc = 999; +//static u32_t old_perc = 999; static void spiffs_check_cb_f(spiffs_check_type type, spiffs_check_report report, u32_t arg1, u32_t arg2) { /* if (report == SPIFFS_CHECK_PROGRESS && old_perc != arg1) { @@ -458,7 +457,11 @@ void fs_reset_specific(u32_t addr_offset, u32_t phys_addr, u32_t phys_size, memset(erases,0,sizeof(erases)); memset(_cache,0,sizeof(_cache)); +#if SPIFFS_USE_MAGIC s32_t res = fs_mount_specific(phys_addr, phys_size, phys_sector_size, log_block_size, log_page_size); +#else + fs_mount_specific(phys_addr, phys_size, phys_sector_size, log_block_size, log_page_size); +#endif #if SPIFFS_USE_MAGIC if (res == SPIFFS_OK) { @@ -539,7 +542,6 @@ void real_assert(int c, const char *n, const char *file, int l) { } int read_and_verify(char *name) { - s32_t res; int fd = SPIFFS_open(&__fs, name, SPIFFS_RDONLY, 0); if (fd < 0) { printf(" read_and_verify: could not open file %s\n", name); @@ -891,7 +893,7 @@ int run_file_config(int cfg_count, tfile_conf* cfgs, int max_runs, int max_concu res = SPIFFS_remove(FS, tf->name); CHECK_RES(res); remove(make_test_fname(tf->name)); - memset(tf, 0, sizeof(tf)); + memset(tf, 0, sizeof(*tf)); } } diff --git a/tools/unit-test-app/components/unity/unity_platform.c b/tools/unit-test-app/components/unity/unity_platform.c index ac7b88a0..49cae755 100644 --- a/tools/unit-test-app/components/unity/unity_platform.c +++ b/tools/unit-test-app/components/unity/unity_platform.c @@ -185,6 +185,8 @@ static void unity_run_single_test_by_index_parse(const char* filter, int index_m int test_index = strtol(filter, NULL, 10); if (test_index >= 1 && test_index <= index_max) { + extern uint32_t system_get_cpu_freq(void); + uint32_t start; asm volatile ("rsr %0, CCOUNT" : "=r" (start)); unity_run_single_test_by_index(test_index - 1); diff --git a/tools/unit-test-app/main/app_main.c b/tools/unit-test-app/main/app_main.c index e33c9697..dab076a8 100644 --- a/tools/unit-test-app/main/app_main.c +++ b/tools/unit-test-app/main/app_main.c @@ -1,7 +1,6 @@ #include #include -#include "esp_sta.h" #include "esp_system.h" #include "freertos/FreeRTOS.h" @@ -18,6 +17,5 @@ void unityTask(void *pvParameters) void app_main(void) { - wifi_station_set_auto_connect(false); xTaskCreate(unityTask, "unityTask", 8192, NULL, UNITY_FREERTOS_PRIORITY, NULL); }