Skip to content

Commit 5e8be46

Browse files
committed
Merge pull request #1552 from andig/spiffs
Change %i to %d for ets_printf compatibility
2 parents 339140c + 1d5d1c1 commit 5e8be46

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed

cores/esp8266/spiffs/spiffs_nucleus.c

+33-33
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ s32_t spiffs_obj_lu_scan(
349349
#if SPIFFS_USE_MAGIC
350350
if (unerased_bix != (spiffs_block_ix)-1) {
351351
// found one unerased block, remedy
352-
SPIFFS_DBG("mount: erase block %i\n", bix);
352+
SPIFFS_DBG("mount: erase block %d\n", bix);
353353
res = spiffs_erase_block(fs, unerased_bix);
354354
SPIFFS_CHECK_RES(res);
355355
}
@@ -706,7 +706,7 @@ s32_t spiffs_object_create(
706706
// find free entry
707707
res = spiffs_obj_lu_find_free(fs, fs->free_cursor_block_ix, fs->free_cursor_obj_lu_entry, &bix, &entry);
708708
SPIFFS_CHECK_RES(res);
709-
SPIFFS_DBG("create: found free page @ %04x bix:%i entry:%i\n", SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry), bix, entry);
709+
SPIFFS_DBG("create: found free page @ %04x bix:%d entry:%d\n", SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry), bix, entry);
710710

711711
// occupy page in object lookup
712712
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT,
@@ -811,7 +811,7 @@ void spiffs_cb_object_event(
811811
if (cur_fd->file_nbr == 0 || (cur_fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG) != obj_id) continue;
812812
if (spix == 0) {
813813
if (ev == SPIFFS_EV_IX_NEW || ev == SPIFFS_EV_IX_UPD) {
814-
SPIFFS_DBG(" callback: setting fd %i:%04x objix_hdr_pix to %04x, size:%i\n", cur_fd->file_nbr, cur_fd->obj_id, new_pix, new_size);
814+
SPIFFS_DBG(" callback: setting fd %d:%04x objix_hdr_pix to %04x, size:%d\n", cur_fd->file_nbr, cur_fd->obj_id, new_pix, new_size);
815815
cur_fd->objix_hdr_pix = new_pix;
816816
if (new_size != 0) {
817817
cur_fd->size = new_size;
@@ -823,7 +823,7 @@ void spiffs_cb_object_event(
823823
}
824824
if (cur_fd->cursor_objix_spix == spix) {
825825
if (ev == SPIFFS_EV_IX_NEW || ev == SPIFFS_EV_IX_UPD) {
826-
SPIFFS_DBG(" callback: setting fd %i:%04x span:%04x objix_pix to %04x\n", cur_fd->file_nbr, cur_fd->obj_id, spix, new_pix);
826+
SPIFFS_DBG(" callback: setting fd %d:%04x span:%04x objix_pix to %04x\n", cur_fd->file_nbr, cur_fd->obj_id, spix, new_pix);
827827
cur_fd->cursor_objix_pix = new_pix;
828828
} else {
829829
cur_fd->cursor_objix_pix = 0;
@@ -883,7 +883,7 @@ s32_t spiffs_object_open_by_page(
883883

884884
SPIFFS_VALIDATE_OBJIX(oix_hdr.p_hdr, fd->obj_id, 0);
885885

886-
SPIFFS_DBG("open: fd %i is obj id %04x\n", fd->file_nbr, fd->obj_id);
886+
SPIFFS_DBG("open: fd %d is obj id %04x\n", fd->file_nbr, fd->obj_id);
887887

888888
return res;
889889
}
@@ -895,7 +895,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
895895
s32_t res = SPIFFS_OK;
896896
u32_t written = 0;
897897

898-
SPIFFS_DBG("append: %i bytes @ offs %i of size %i\n", len, offset, fd->size);
898+
SPIFFS_DBG("append: %d bytes @ offs %d of size %d\n", len, offset, fd->size);
899899

900900
if (offset > fd->size) {
901901
SPIFFS_DBG("append: offset reversed to size\n");
@@ -904,7 +904,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
904904

905905
res = spiffs_gc_check(fs, len + SPIFFS_DATA_PAGE_SIZE(fs)); // add an extra page of data worth for meta
906906
if (res != SPIFFS_OK) {
907-
SPIFFS_DBG("append: gc check fail %i\n", res);
907+
SPIFFS_DBG("append: gc check fail %d\n", res);
908908
}
909909
SPIFFS_CHECK_RES(res);
910910

@@ -932,7 +932,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
932932
// within this clause we return directly if something fails, object index mess-up
933933
if (written > 0) {
934934
// store previous object index page, unless first pass
935-
SPIFFS_DBG("append: %04x store objix %04x:%04x, written %i\n", fd->obj_id,
935+
SPIFFS_DBG("append: %04x store objix %04x:%04x, written %d\n", fd->obj_id,
936936
cur_objix_pix, prev_objix_spix, written);
937937
if (prev_objix_spix == 0) {
938938
// this is an update to object index header page
@@ -949,7 +949,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
949949
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
950950
fd->objix_hdr_pix, fs->work, 0, offset+written, &new_objix_hdr_page);
951951
SPIFFS_CHECK_RES(res);
952-
SPIFFS_DBG("append: %04x store new objix_hdr, %04x:%04x, written %i\n", fd->obj_id,
952+
SPIFFS_DBG("append: %04x store new objix_hdr, %04x:%04x, written %d\n", fd->obj_id,
953953
new_objix_hdr_page, 0, written);
954954
}
955955
} else {
@@ -965,7 +965,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
965965
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
966966
fd->objix_hdr_pix, 0, 0, offset+written, &new_objix_hdr_page);
967967
SPIFFS_CHECK_RES(res);
968-
SPIFFS_DBG("append: %04x store new size I %i in objix_hdr, %04x:%04x, written %i\n", fd->obj_id,
968+
SPIFFS_DBG("append: %04x store new size I %d in objix_hdr, %04x:%04x, written %d\n", fd->obj_id,
969969
offset+written, new_objix_hdr_page, 0, written);
970970
}
971971
fd->size = offset+written;
@@ -994,7 +994,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
994994
// quick "load" of new object index page
995995
memset(fs->work, 0xff, SPIFFS_CFG_LOG_PAGE_SZ(fs));
996996
memcpy(fs->work, &p_hdr, sizeof(spiffs_page_header));
997-
SPIFFS_DBG("append: %04x create objix page, %04x:%04x, written %i\n", fd->obj_id
997+
SPIFFS_DBG("append: %04x create objix page, %04x:%04x, written %d\n", fd->obj_id
998998
, cur_objix_pix, cur_objix_spix, written);
999999
} else {
10001000
// on first pass, we load existing object index page
@@ -1006,7 +1006,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
10061006
res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &pix);
10071007
SPIFFS_CHECK_RES(res);
10081008
}
1009-
SPIFFS_DBG("append: %04x found object index at page %04x [fd size %i]\n", fd->obj_id, pix, fd->size);
1009+
SPIFFS_DBG("append: %04x found object index at page %04x [fd size %d]\n", fd->obj_id, pix, fd->size);
10101010
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ,
10111011
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
10121012
SPIFFS_CHECK_RES(res);
@@ -1030,7 +1030,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
10301030
p_hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_FINAL); // finalize immediately
10311031
res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG,
10321032
&p_hdr, &data[written], to_write, page_offs, 1, &data_page);
1033-
SPIFFS_DBG("append: %04x store new data page, %04x:%04x offset:%i, len %i, written %i\n", fd->obj_id,
1033+
SPIFFS_DBG("append: %04x store new data page, %04x:%04x offset:%d, len %d, written %d\n", fd->obj_id,
10341034
data_page, data_spix, page_offs, to_write, written);
10351035
} else {
10361036
// append to existing page, fill out free data in existing page
@@ -1047,7 +1047,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
10471047

10481048
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT,
10491049
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, data_page) + sizeof(spiffs_page_header) + page_offs, to_write, &data[written]);
1050-
SPIFFS_DBG("append: %04x store to existing data page, %04x:%04x offset:%i, len %i, written %i\n", fd->obj_id
1050+
SPIFFS_DBG("append: %04x store to existing data page, %04x:%04x offset:%d, len %d, written %d\n", fd->obj_id
10511051
, data_page, data_spix, page_offs, to_write, written);
10521052
}
10531053

@@ -1083,7 +1083,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
10831083
if (cur_objix_spix != 0) {
10841084
// wrote beyond object index header page
10851085
// write last modified object index page, unless object header index page
1086-
SPIFFS_DBG("append: %04x store objix page, %04x:%04x, written %i\n", fd->obj_id,
1086+
SPIFFS_DBG("append: %04x store objix page, %04x:%04x, written %d\n", fd->obj_id,
10871087
cur_objix_pix, cur_objix_spix, written);
10881088

10891089
res2 = spiffs_page_index_check(fs, fd, cur_objix_pix, cur_objix_spix);
@@ -1097,15 +1097,15 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
10971097
// update size in object header index page
10981098
res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
10991099
fd->objix_hdr_pix, 0, 0, offset+written, &new_objix_hdr_page);
1100-
SPIFFS_DBG("append: %04x store new size II %i in objix_hdr, %04x:%04x, written %i, res %i\n", fd->obj_id
1100+
SPIFFS_DBG("append: %04x store new size II %d in objix_hdr, %04x:%04x, written %d, res %d\n", fd->obj_id
11011101
, offset+written, new_objix_hdr_page, 0, written, res2);
11021102
SPIFFS_CHECK_RES(res2);
11031103
} else {
11041104
// wrote within object index header page
11051105
if (offset == 0) {
11061106
// wrote to empty object - simply update size and write whole page
11071107
objix_hdr->size = offset+written;
1108-
SPIFFS_DBG("append: %04x store fresh objix_hdr page, %04x:%04x, written %i\n", fd->obj_id
1108+
SPIFFS_DBG("append: %04x store fresh objix_hdr page, %04x:%04x, written %d\n", fd->obj_id
11091109
, cur_objix_pix, cur_objix_spix, written);
11101110

11111111
res2 = spiffs_page_index_check(fs, fd, cur_objix_pix, cur_objix_spix);
@@ -1120,7 +1120,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
11201120
// modifying object index header page, update size and make new copy
11211121
res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
11221122
fd->objix_hdr_pix, fs->work, 0, offset+written, &new_objix_hdr_page);
1123-
SPIFFS_DBG("append: %04x store modified objix_hdr page, %04x:%04x, written %i\n", fd->obj_id
1123+
SPIFFS_DBG("append: %04x store modified objix_hdr page, %04x:%04x, written %d\n", fd->obj_id
11241124
, new_objix_hdr_page, 0, written);
11251125
SPIFFS_CHECK_RES(res2);
11261126
}
@@ -1168,7 +1168,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
11681168
// store previous object index header page
11691169
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
11701170
fd->objix_hdr_pix, fs->work, 0, 0, &new_objix_hdr_pix);
1171-
SPIFFS_DBG("modify: store modified objix_hdr page, %04x:%04x, written %i\n", new_objix_hdr_pix, 0, written);
1171+
SPIFFS_DBG("modify: store modified objix_hdr page, %04x:%04x, written %d\n", new_objix_hdr_pix, 0, written);
11721172
SPIFFS_CHECK_RES(res);
11731173
} else {
11741174
// store new version of previous object index page
@@ -1178,7 +1178,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
11781178
SPIFFS_CHECK_RES(res);
11791179

11801180
res = spiffs_page_move(fs, fd->file_nbr, (u8_t*)objix, fd->obj_id, 0, cur_objix_pix, &new_objix_pix);
1181-
SPIFFS_DBG("modify: store previous modified objix page, %04x:%04x, written %i\n", new_objix_pix, objix->p_hdr.span_ix, written);
1181+
SPIFFS_DBG("modify: store previous modified objix page, %04x:%04x, written %d\n", new_objix_pix, objix->p_hdr.span_ix, written);
11821182
SPIFFS_CHECK_RES(res);
11831183
spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
11841184
}
@@ -1233,7 +1233,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
12331233
// a full page, allocate and write a new page of data
12341234
res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG,
12351235
&p_hdr, &data[written], to_write, page_offs, 1, &data_pix);
1236-
SPIFFS_DBG("modify: store new data page, %04x:%04x offset:%i, len %i, written %i\n", data_pix, data_spix, page_offs, to_write, written);
1236+
SPIFFS_DBG("modify: store new data page, %04x:%04x offset:%d, len %d, written %d\n", data_pix, data_spix, page_offs, to_write, written);
12371237
} else {
12381238
// write to existing page, allocate new and copy unmodified data
12391239

@@ -1274,7 +1274,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
12741274
(u8_t *)&p_hdr.flags);
12751275
if (res != SPIFFS_OK) break;
12761276

1277-
SPIFFS_DBG("modify: store to existing data page, src:%04x, dst:%04x:%04x offset:%i, len %i, written %i\n", orig_data_pix, data_pix, data_spix, page_offs, to_write, written);
1277+
SPIFFS_DBG("modify: store to existing data page, src:%04x, dst:%04x:%04x offset:%d, len %d, written %d\n", orig_data_pix, data_pix, data_spix, page_offs, to_write, written);
12781278
}
12791279

12801280
// delete original data page
@@ -1313,7 +1313,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
13131313
SPIFFS_CHECK_RES(res2);
13141314

13151315
res2 = spiffs_page_move(fs, fd->file_nbr, (u8_t*)objix, fd->obj_id, 0, cur_objix_pix, &new_objix_pix);
1316-
SPIFFS_DBG("modify: store modified objix page, %04x:%04x, written %i\n", new_objix_pix, cur_objix_spix, written);
1316+
SPIFFS_DBG("modify: store modified objix page, %04x:%04x, written %d\n", new_objix_pix, cur_objix_spix, written);
13171317
fd->cursor_objix_pix = new_objix_pix;
13181318
fd->cursor_objix_spix = cur_objix_spix;
13191319
SPIFFS_CHECK_RES(res2);
@@ -1323,7 +1323,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
13231323
// wrote within object index header page
13241324
res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
13251325
fd->objix_hdr_pix, fs->work, 0, 0, &new_objix_hdr_pix);
1326-
SPIFFS_DBG("modify: store modified objix_hdr page, %04x:%04x, written %i\n", new_objix_hdr_pix, 0, written);
1326+
SPIFFS_DBG("modify: store modified objix_hdr page, %04x:%04x, written %d\n", new_objix_hdr_pix, 0, written);
13271327
SPIFFS_CHECK_RES(res2);
13281328
}
13291329

@@ -1444,7 +1444,7 @@ s32_t spiffs_object_truncate(
14441444
spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_DEL, fd->obj_id, objix->p_hdr.span_ix, objix_pix, 0);
14451445
if (prev_objix_spix > 0) {
14461446
// update object index header page
1447-
SPIFFS_DBG("truncate: update objix hdr page %04x:%04x to size %i\n", fd->objix_hdr_pix, prev_objix_spix, cur_size);
1447+
SPIFFS_DBG("truncate: update objix hdr page %04x:%04x to size %d\n", fd->objix_hdr_pix, prev_objix_spix, cur_size);
14481448
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
14491449
fd->objix_hdr_pix, 0, 0, cur_size, &new_objix_hdr_pix);
14501450
SPIFFS_CHECK_RES(res);
@@ -1487,14 +1487,14 @@ s32_t spiffs_object_truncate(
14871487
// delete full data page
14881488
res = spiffs_page_data_check(fs, fd, data_pix, data_spix);
14891489
if (res != SPIFFS_ERR_DELETED && res != SPIFFS_OK && res != SPIFFS_ERR_INDEX_REF_FREE) {
1490-
SPIFFS_DBG("truncate: err validating data pix %i\n", res);
1490+
SPIFFS_DBG("truncate: err validating data pix %d\n", res);
14911491
break;
14921492
}
14931493

14941494
if (res == SPIFFS_OK) {
14951495
res = spiffs_page_delete(fs, data_pix);
14961496
if (res != SPIFFS_OK) {
1497-
SPIFFS_DBG("truncate: err deleting data pix %i\n", res);
1497+
SPIFFS_DBG("truncate: err deleting data pix %d\n", res);
14981498
break;
14991499
}
15001500
} else if (res == SPIFFS_ERR_DELETED || res == SPIFFS_ERR_INDEX_REF_FREE) {
@@ -1509,13 +1509,13 @@ s32_t spiffs_object_truncate(
15091509
}
15101510
fd->size = cur_size;
15111511
fd->offset = cur_size;
1512-
SPIFFS_DBG("truncate: delete data page %04x for data spix:%04x, cur_size:%i\n", data_pix, data_spix, cur_size);
1512+
SPIFFS_DBG("truncate: delete data page %04x for data spix:%04x, cur_size:%d\n", data_pix, data_spix, cur_size);
15131513
} else {
15141514
// delete last page, partially
15151515
spiffs_page_header p_hdr;
15161516
spiffs_page_ix new_data_pix;
15171517
u32_t bytes_to_remove = SPIFFS_DATA_PAGE_SIZE(fs) - (new_size % SPIFFS_DATA_PAGE_SIZE(fs));
1518-
SPIFFS_DBG("truncate: delete %i bytes from data page %04x for data spix:%04x, cur_size:%i\n", bytes_to_remove, data_pix, data_spix, cur_size);
1518+
SPIFFS_DBG("truncate: delete %d bytes from data page %04x for data spix:%04x, cur_size:%d\n", bytes_to_remove, data_pix, data_spix, cur_size);
15191519

15201520
res = spiffs_page_data_check(fs, fd, data_pix, data_spix);
15211521
if (res != SPIFFS_OK) break;
@@ -1670,7 +1670,7 @@ s32_t spiffs_object_read(
16701670
len_to_read = MIN(len_to_read, SPIFFS_DATA_PAGE_SIZE(fs) - (cur_offset % SPIFFS_DATA_PAGE_SIZE(fs)));
16711671
// remaining data in file
16721672
len_to_read = MIN(len_to_read, fd->size);
1673-
SPIFFS_DBG("read: offset:%i rd:%i data spix:%04x is data_pix:%04x addr:%08x\n", cur_offset, len_to_read, data_spix, data_pix,
1673+
SPIFFS_DBG("read: offset:%d rd:%d data spix:%04x is data_pix:%04x addr:%08x\n", cur_offset, len_to_read, data_spix, data_pix,
16741674
SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header) + (cur_offset % SPIFFS_DATA_PAGE_SIZE(fs)));
16751675
if (len_to_read <= 0) {
16761676
res = SPIFFS_ERR_END_OF_OBJECT;
@@ -1756,7 +1756,7 @@ static s32_t spiffs_obj_lu_find_free_obj_id_compact_v(spiffs *fs, spiffs_obj_id
17561756
if (id >= state->min_obj_id && id <= state->max_obj_id) {
17571757
u8_t *map = (u8_t *)fs->work;
17581758
int ix = (id - state->min_obj_id) / state->compaction;
1759-
//SPIFFS_DBG("free_obj_id: add ix %i for id %04x min:%04x max%04x comp:%i\n", ix, id, state->min_obj_id, state->max_obj_id, state->compaction);
1759+
//SPIFFS_DBG("free_obj_id: add ix %d for id %04x min:%04x max%04x comp:%d\n", ix, id, state->min_obj_id, state->max_obj_id, state->compaction);
17601760
map[ix]++;
17611761
}
17621762
}
@@ -1829,7 +1829,7 @@ s32_t spiffs_obj_lu_find_free_obj_id(spiffs *fs, spiffs_obj_id *obj_id, const u8
18291829
return SPIFFS_ERR_FULL;
18301830
}
18311831

1832-
SPIFFS_DBG("free_obj_id: COMP select index:%i min_count:%i min:%04x max:%04x compact:%i\n", min_i, min_count, state.min_obj_id, state.max_obj_id, state.compaction);
1832+
SPIFFS_DBG("free_obj_id: COMP select index:%d min_count:%d min:%04x max:%04x compact:%d\n", min_i, min_count, state.min_obj_id, state.max_obj_id, state.compaction);
18331833

18341834
if (min_count == 0) {
18351835
// no id in this range, skip compacting and use directly
@@ -1849,7 +1849,7 @@ s32_t spiffs_obj_lu_find_free_obj_id(spiffs *fs, spiffs_obj_id *obj_id, const u8
18491849
// in a work memory of log_page_size bytes, we may fit in log_page_size ids
18501850
// todo what if compaction is > 255 - then we cannot fit it in a byte
18511851
state.compaction = (state.max_obj_id-state.min_obj_id) / ((SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(u8_t)));
1852-
SPIFFS_DBG("free_obj_id: COMP min:%04x max:%04x compact:%i\n", state.min_obj_id, state.max_obj_id, state.compaction);
1852+
SPIFFS_DBG("free_obj_id: COMP min:%04x max:%04x compact:%d\n", state.min_obj_id, state.max_obj_id, state.compaction);
18531853

18541854
memset(fs->work, 0, SPIFFS_CFG_LOG_PAGE_SZ(fs));
18551855
res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_obj_lu_find_free_obj_id_compact_v, &state, 0, 0, 0);

cores/esp8266/spiffs_api.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ class SPIFFSFileImpl : public FileImpl {
274274

275275
size_t read(uint8_t* buf, size_t size) override {
276276
CHECKFD();
277-
278277
auto result = SPIFFS_read(_fs->getFs(), _fd, (void*) buf, size);
279278
if (result < 0) {
280279
DEBUGV("SPIFFS_read rc=%d\r\n", result);

0 commit comments

Comments
 (0)