pellepl / spiffs

Wear-leveled SPI flash file system for embedded devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

User defined hook for long running operations

josesimoes opened this issue · comments

First: a BIG thank you for this awesome project! 👏

I'm using it for some large (and not so large) flash chips and I've run into some issues when performing long running operations like format.
When flash operations take a considerable time (as expected) my watchdog is kicking in and resetting the CPU.

Was thinking that long running operations could include in the loops that responsible for those long running operations a simple call to a user defined function.
This would be a simple define that's empty as default.
If needed the user can implement it's function with whatever content works for it's use case. In my particular situation it would be a call to the API responsible to feed the watchdog.

I can submit a PR with this, just wanted to throw this idea for comments.

Just a thought: If it is only formatting and GC you're having in mind, the user hal function for erasing blocks could include that callback.

Interesting... I'll give it a try.

This works perfectly! Thank you so much for the suggestion. 👏 💯