PaulStoffregen / SD

70 stars 41 forks source link

Update SD.h #25

Closed WMXZ-EU closed 3 years ago

WMXZ-EU commented 3 years ago

Allow more flexible configuration of SdFs

WMXZ-EU commented 3 years ago

should first test the changes

PaulStoffregen commented 3 years ago

My intention was to keep the main sdfs object public. So if anyone wants to do special initialization, they can just delete this:

SD.begin(pin);

and write this instead:

SD.sdfs.begin(spiConfig);

The idea is you can also just replace "sd" in most SdFat programs with "SD.sdfs". So if you want to open files without the File & SDFile layer adding overhead and limiting you to only the Arduino API, you can just call SD.sdfs.open(filename) and get the actual SdFat file classes.

WMXZ-EU commented 3 years ago

OK, after I realized that my suggestion did not compile, I closed the PR and was finding your suggestion "SD.sdfs.begin"