Skip to content

Commit 520b213

Browse files
committed
fix(example): Fix example compile warning
1 parent 35ee995 commit 520b213

File tree

9 files changed

+18
-15
lines changed

9 files changed

+18
-15
lines changed

examples/protocols/aws_iot/subscribe_publish/main/subscribe_publish_sample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void aws_iot_task(void *param) {
280280
continue;
281281
}
282282

283-
ESP_LOGI(TAG, "Stack remaining for task '%s' is %d bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL));
283+
ESP_LOGI(TAG, "Stack remaining for task '%s' is %lu bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL));
284284
vTaskDelay(1000 / portTICK_RATE_MS);
285285
sprintf(cPayload, "%s : %d ", "hello from ESP32 (QOS0)", i++);
286286
paramsQOS0.payloadLen = strlen(cPayload);

examples/protocols/aws_iot/thing_shadow/main/thing_shadow_sample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void aws_iot_task(void *param) {
316316
}
317317
}
318318
ESP_LOGI(TAG, "*****************************************************************************************");
319-
ESP_LOGI(TAG, "Stack remaining for task '%s' is %d bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL));
319+
ESP_LOGI(TAG, "Stack remaining for task '%s' is %lu bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL));
320320

321321
vTaskDelay(1000 / portTICK_RATE_MS);
322322
}

examples/storage/spiffs_test/main/component.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
# "main" pseudo-component makefile.
33
#
44
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
5+
6+
CFLAGS += -Wno-error=implicit-function-declaration \
7+
-Wno-error=unused-label \
8+
-Wno-implicit-function-declaration \
9+
-Wno-unused-label

examples/storage/spiffs_test/main/test_bugreports.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ TEST(nodemcu_309) {
191191
fd = SPIFFS_open(FS, fname, SPIFFS_RDWR | SPIFFS_CREAT | SPIFFS_TRUNC | SPIFFS_DIRECT, 0);
192192
TEST_CHECK(fd > 0);
193193
int i;
194-
spiffs_stat s;
195194
res = SPIFFS_OK;
196195
u8_t err = 0;
197196
for (i = 1; i <= 1280; i++) {
@@ -244,7 +243,6 @@ TEST(robert) {
244243
sprintf(fname, "test.txt");
245244
fd = SPIFFS_open(FS, fname, SPIFFS_RDWR | SPIFFS_CREAT | SPIFFS_TRUNC, 0);
246245
TEST_CHECK(fd > 0);
247-
int i;
248246
res = SPIFFS_OK;
249247
char buf[500];
250248
memset(buf, 0xaa, 500);

examples/storage/spiffs_test/main/test_hydrogen.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ TEST(list_dir)
233233
while ((pe = SPIFFS_readdir(&d, pe))) {
234234
printf(" %s [%04x] size:%i\n", pe->name, pe->obj_id, pe->size);
235235
for (i = 0; i < file_cnt; i++) {
236-
if (strcmp(files[i], pe->name) == 0) {
236+
if (strcmp(files[i], (char *)pe->name) == 0) {
237237
found++;
238238
break;
239239
}
@@ -276,7 +276,7 @@ TEST(open_by_dirent) {
276276
while ((pe = SPIFFS_readdir(&d, pe))) {
277277
spiffs_file fd = SPIFFS_open_by_dirent(FS, pe, SPIFFS_RDWR, 0);
278278
TEST_CHECK(fd >= 0);
279-
res = read_and_verify_fd(fd, pe->name);
279+
res = read_and_verify_fd(fd, (char *)pe->name);
280280
TEST_CHECK(res == SPIFFS_OK);
281281
fd = SPIFFS_open_by_dirent(FS, pe, SPIFFS_RDWR, 0);
282282
TEST_CHECK(fd >= 0);
@@ -872,7 +872,6 @@ TEST(lseek_simple_modification) {
872872
int res;
873873
spiffs_file fd;
874874
char *fname = "seekfile";
875-
int i;
876875
int len = 4096;
877876
fd = SPIFFS_open(FS, fname, SPIFFS_TRUNC | SPIFFS_CREAT | SPIFFS_RDWR, 0);
878877
TEST_CHECK(fd > 0);
@@ -914,7 +913,6 @@ TEST(lseek_modification_append) {
914913
int res;
915914
spiffs_file fd;
916915
char *fname = "seekfile";
917-
int i;
918916
int len = 4096;
919917
fd = SPIFFS_open(FS, fname, SPIFFS_TRUNC | SPIFFS_CREAT | SPIFFS_RDWR, 0);
920918
TEST_CHECK(fd > 0);

examples/storage/spiffs_test/main/test_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void spiffs_fs1_init(void)
6363
esp_spiffs_init(&config);
6464
}
6565

66-
void user_init(void)
66+
void app_main(void)
6767
{
6868
spiffs_fs1_init();
6969

examples/storage/spiffs_test/main/test_spiffs.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ static s32_t _read(u32_t addr, u32_t size, u8_t *dst) {
170170
}
171171

172172
static s32_t _write(u32_t addr, u32_t size, u8_t *src) {
173-
int i;
174173
//printf("wr %08x %i\n", addr, size);
175174
if (log_flash_ops) {
176175
bytes_wr += size;
@@ -375,7 +374,7 @@ void dump_flash_access_stats() {
375374
}
376375

377376

378-
static u32_t old_perc = 999;
377+
//static u32_t old_perc = 999;
379378
static void spiffs_check_cb_f(spiffs_check_type type, spiffs_check_report report,
380379
u32_t arg1, u32_t arg2) {
381380
/* 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,
458457
memset(erases,0,sizeof(erases));
459458
memset(_cache,0,sizeof(_cache));
460459

460+
#if SPIFFS_USE_MAGIC
461461
s32_t res = fs_mount_specific(phys_addr, phys_size, phys_sector_size, log_block_size, log_page_size);
462+
#else
463+
fs_mount_specific(phys_addr, phys_size, phys_sector_size, log_block_size, log_page_size);
464+
#endif
462465

463466
#if SPIFFS_USE_MAGIC
464467
if (res == SPIFFS_OK) {
@@ -539,7 +542,6 @@ void real_assert(int c, const char *n, const char *file, int l) {
539542
}
540543

541544
int read_and_verify(char *name) {
542-
s32_t res;
543545
int fd = SPIFFS_open(&__fs, name, SPIFFS_RDONLY, 0);
544546
if (fd < 0) {
545547
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
891893
res = SPIFFS_remove(FS, tf->name);
892894
CHECK_RES(res);
893895
remove(make_test_fname(tf->name));
894-
memset(tf, 0, sizeof(tf));
896+
memset(tf, 0, sizeof(*tf));
895897
}
896898

897899
}

tools/unit-test-app/components/unity/unity_platform.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ static void unity_run_single_test_by_index_parse(const char* filter, int index_m
185185
int test_index = strtol(filter, NULL, 10);
186186
if (test_index >= 1 && test_index <= index_max)
187187
{
188+
extern uint32_t system_get_cpu_freq(void);
189+
188190
uint32_t start;
189191
asm volatile ("rsr %0, CCOUNT" : "=r" (start));
190192
unity_run_single_test_by_index(test_index - 1);

tools/unit-test-app/main/app_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <stdio.h>
22
#include <stdint.h>
33

4-
#include "esp_sta.h"
54
#include "esp_system.h"
65

76
#include "freertos/FreeRTOS.h"
@@ -18,6 +17,5 @@ void unityTask(void *pvParameters)
1817

1918
void app_main(void)
2019
{
21-
wifi_station_set_auto_connect(false);
2220
xTaskCreate(unityTask, "unityTask", 8192, NULL, UNITY_FREERTOS_PRIORITY, NULL);
2321
}

0 commit comments

Comments
 (0)