Skip to content

Commit

Permalink
workaround: solo5 reads a single sector 512 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshi Doyu committed Apr 8, 2019
1 parent f91e250 commit 6a2c180
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fat_fs.ml
Expand Up @@ -81,7 +81,8 @@ module Make (B: Mirage_block_lwt.S) = struct
else if Cstruct.len buf <= 512 then [ buf ]
else Cstruct.sub buf 0 512 :: (split (Cstruct.shift buf 512))
in
let page = alloc 4096 in
B.get_info device >>= fun {sector_size; _} ->
let page = alloc sector_size in
let rec loop sector_size = function
| [] -> Lwt.return (Ok ())
| (sector, buffer) :: xs ->
Expand All @@ -94,7 +95,6 @@ module Make (B: Mirage_block_lwt.S) = struct
Cstruct.blit page (offset mod sector_size) buffer 0 512;
loop sector_size xs
in
B.get_info device >>= fun {sector_size; _} ->
loop sector_size (List.combine xs (split buf)) >|*= fun () ->
Ok buf

Expand Down

0 comments on commit 6a2c180

Please sign in to comment.