-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for dynamic BLOCK_COUNT
#2
Comments
I agree, |
Missing upstream: littlefs-project/littlefs#349 |
Propagate errors in callbacks
Is it possible to pass the block count to the function at runtime if I know it, even if littlefs doesn't? Currently it seems I have to hardcode the volume size. I am developing for ESP32, and littlefs is using one partition of the flash. I can read the partition table, which gets me the length, and using that would make me feel much better than hardcoding the size. If I've missed something please let me know! |
Unfortunately this is currently not possible. We could remove all associated constants from the |
That seems like a good idea to me. It would allow for reading any filesystem discovered at runtime, rather than just ones the developer thought of. It is not a serious issue in my case: I came up with a workaround where the app reads the partition table and makes sure the hardcoded values are correct, which is robust enough for me. But it would be a nice feature.
Maybe constants vital to the Storage implementation (like block size) could be put in the trait? That would remove some flexibility, though. |
Isn’t that what we have right now? |
I meant the ones that are hardware-dependent, like block size. But rethinking it, yeah, it should probably be all or nothing, and force the Storage implementer to do validation. |
Currently the user has to statically know the device size since
BLOCK_COUNT
is an associated constant. It would be useful if it would be possible to dynamically determine the device size instead.The text was updated successfully, but these errors were encountered: