Skip to content
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

Remove littlefs2 macros #72

Open
robin-nitrokey opened this issue Nov 19, 2024 · 0 comments
Open

Remove littlefs2 macros #72

robin-nitrokey opened this issue Nov 19, 2024 · 0 comments

Comments

@robin-nitrokey
Copy link
Contributor

robin-nitrokey commented Nov 19, 2024

  • littlefs2_prince_filesystem always enables the entire PRINCE region 2 which can be problematic if this region is not used exclusively for the filesystem. It is hard to provide a correct and general implementation so I would transform this macro into an example that can be adapted depending on the use case.
    self.prince.enable_region_2_for(||{
    let flash: *const u8 = (Self::BASE_OFFSET + off) as *const u8;
    for i in 0 .. buf.len() {
    buf[i] = unsafe{ *flash.offset(i as isize) };
    }
    });
  • littlefs2_filesystem could just be a struct using const generics.
    macro_rules! littlefs2_filesystem {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant