Merge pull request #923 from DiUS/spiffs-alignment-fix-915
Ugly workaround for broken SPIFFS GC alignment.
This commit is contained in:
commit
a4e7885a6e
|
@ -250,6 +250,10 @@ s32_t spiffs_gc_find_candidate(
|
||||||
|
|
||||||
// divide up work area into block indices and scores
|
// divide up work area into block indices and scores
|
||||||
// todo alignment?
|
// 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;
|
spiffs_block_ix *cand_blocks = (spiffs_block_ix *)fs->work;
|
||||||
s32_t *cand_scores = (s32_t *)(fs->work + max_candidates * sizeof(spiffs_block_ix));
|
s32_t *cand_scores = (s32_t *)(fs->work + max_candidates * sizeof(spiffs_block_ix));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue