gauteh / sfy

🌊 A lightweight wave buoy for near-shore deployments.
MIT License
39 stars 6 forks source link

More than approx 290 packages inside binary file causes too long write times #77

Closed gauteh closed 2 years ago

gauteh commented 2 years ago

With more than about 290 packages in a collection of files we start getting FifoOverrun, i.e. the RTC interrupt is not run often enough. The only part that is in a critical section is the actual write (https://github.com/gauteh/sfy/blob/main/sfy-buoy/src/storage/mod.rs#L210). The immediate solution is to cap the package size to something like 250 packages (at 24MHz SPI for storage, but 150 package for 12MHz).

Could also move the Kalman-filter to the main loop and just collect samples in the interrupt, this would make it easier to write raw-data to the SD-card -- if we have time.

Maybe due to file being re-located when size increases.