Skip to content

Commit

Permalink
converted fatfs to new interface, tested with patch SD example
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhensley committed Dec 17, 2021
1 parent 7b0700a commit 30ae9ca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/genlib_daisy.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ static bool update = false;
static const uint32_t OOPSY_SRAM_SIZE = 512 * 1024;
static const uint32_t OOPSY_SDRAM_SIZE = 64 * 1024 * 1024;

// Added dedicated global SDFile to replace old global from libDaisy
FIL SDFile;

namespace oopsy {

uint32_t sram_used = 0, sram_usable = 0;
Expand Down Expand Up @@ -278,6 +281,8 @@ namespace oopsy {
#define OOPSY_WAV_WORKSPACE_BYTES (256)

daisy::SdmmcHandler handler;
daisy::FatFSInterface fsi;

uint8_t workspace[OOPSY_WAV_WORKSPACE_BYTES];

void sdcard_init() {
Expand All @@ -287,8 +292,8 @@ namespace oopsy {
// sdconfig.speed = daisy::SdmmcHandler::Speed::FAST;
sdconfig.width = daisy::SdmmcHandler::BusWidth::BITS_1;
handler.Init(sdconfig);
dsy_fatfs_init();
f_mount(&SDFatFS, SDPath, 1);
fsi.Init(daisy::FatFSInterface::Config::MEDIA_SD);
f_mount(&fsi.GetSDFileSystem(), fsi.GetSDPath(), 1);
}

// TODO: resizing without wasting memory
Expand Down

0 comments on commit 30ae9ca

Please sign in to comment.