From 58427563ed8bd0c77b695cb2e8ccd2f852137faf Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Tue, 12 Jan 2016 17:24:02 +1100 Subject: [PATCH] Ugly workaround for broken SPIFFS GC alignment. Proper fix should be done upstream and pulled in once available. --- app/spiffs/spiffs_gc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/spiffs/spiffs_gc.c b/app/spiffs/spiffs_gc.c index a86f8128..ba52114d 100644 --- a/app/spiffs/spiffs_gc.c +++ b/app/spiffs/spiffs_gc.c @@ -250,6 +250,10 @@ s32_t spiffs_gc_find_candidate( // divide up work area into block indices and scores // todo alignment? + // YES DO PROPER ALIGNMENT !^@#%!@%! + if (max_candidates & 1) + ++max_candidates; // HACK WORKAROUND ICK for sizeof(spiffs_block_idx)==2 + spiffs_block_ix *cand_blocks = (spiffs_block_ix *)fs->work; s32_t *cand_scores = (s32_t *)(fs->work + max_candidates * sizeof(spiffs_block_ix));