Shop OBEX P1 Docs P2 Docs Learn Events
flexspin compiler for P2: Assembly, Spin, BASIC, and C in one compiler - Page 126 — Parallax Forums

flexspin compiler for P2: Assembly, Spin, BASIC, and C in one compiler

1120121122123124126»

Comments

  • evanhevanh Posts: 16,279
    edited 2025-03-03 22:17

    Okay. Looking around I've found cluster size in struct FATFS. Which _vfs_open_fat_handle() creates and passes to f_mount(). The user program calls _vfs_open_fat_handle() during mounting, so access to cluster size is only just below. I'm not sure of C foo to reach it though.

  • ersmithersmith Posts: 6,138

    Worst case I suppose you could always read sector 0 (the BPB) and get it from there. Out of curiosity, why do you want the cluster size?

  • There's a way to grab the internal FATFS struct from the VFS. I think I used it once to proof-of-concept converting paths between long and short names - you'd need that if you had some kind of file explorer application with LFN support and want to launch e.g. MegaYume (no LFN support) with a given file through FC000 ARGv).

  • evanhevanh Posts: 16,279
    edited 2025-03-04 01:35

    @ersmith said:
    Worst case I suppose you could always read sector 0 (the BPB) and get it from there. Out of curiosity, why do you want the cluster size?

    From observation, I'm of the opinion that the file speed testing performs highest when the read/write chunk size (The tester's buffer size) matches the cluster size. Above that level seems to be slightly reduced speed even.

    And how does a program read partition blocks?
    something like fopen("/sd/.","rb"); ??
    EDIT: Nope, errno = 4: No such file or directory

Sign In or Register to comment.