The fifolog code wasn't wrapping the record number, so once the
file filled up it would just continue filling.
This resets the record to the beginning of the file once it
hits the end.
Differential D25478
[fifolog] Wrap to the beginning of the file once the end of the file is reached adrian on Jun 26 2020, 9:23 PM. Authored by Tags None Referenced Files
Details The fifolog code wasn't wrapping the record number, so once the This resets the record to the beginning of the file once it
Diff Detail
Event Timeline
Comment Actions I noticed we were off by one; the file size ended up being one record Comment Actions Yeah, that's clearly an oversight. In the original application this code came from, the write error propagated up and was used to register how many times the flash had been written. That code did not become part of the fifolog_writer(1) program, which silently ignores the errors from fifolog_write_record_poll(). Wrapping in the lib code probably makes most sense in this stand alone usage of the code, but fifolog_writer(1) should also report write errors back. Comment Actions oh! that makes sense! I'll tackle that as a follow-up if you don't mind. I may use this on some NAND device and having callbacks for write errors and record number wrapping would help. |