Any Petit FatFs example?
Posted: Tue Aug 11, 2015 12:01 pm
I am making progress on my fighting fantasy engine, but in order to navigate through the encoded gamebook (a .LDV file on SD-Card) I need a FAT library. I saw that among the 2 available for Gamebuino only Petit FatFs allows to seek (i.e. place the pointer anywhere inside the file, which is what I need). Unfortunately my first attempts at opening the SD file have all failed. I have searched extensively on the net for any Arduino/PetitFatFs example but I didn't find any.
The simple code here:
always returns the error code FR_NOT_ENABLED meaning the SD-Card is not mounted.
This happens even when I am able to press C and install another game from bootloader (!) prooving of course that the SD is available...
I tried opening "/DF01.LDV" instead of "DF01.LDV" to no avail.
Any people here managed to make use of Petit FatFs lib to open a SD file, seek inside it, and read a buffer ?
Thanks in advance for any tip
Nicolas
The simple code here:
- Code: Select all
#include <petit_fatfs.h>
FATFS* fatfs;
[...]
void setup() {
gb.begin();
pf_mount(fatfs);
int ldverr=pf_open("DF01.LDV");
always returns the error code FR_NOT_ENABLED meaning the SD-Card is not mounted.
This happens even when I am able to press C and install another game from bootloader (!) prooving of course that the SD is available...
I tried opening "/DF01.LDV" instead of "DF01.LDV" to no avail.
Any people here managed to make use of Petit FatFs lib to open a SD file, seek inside it, and read a buffer ?
Thanks in advance for any tip
Nicolas