Skip to content

Change SD Card #3607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nemeier opened this issue Aug 1, 2015 · 3 comments
Closed

Change SD Card #3607

nemeier opened this issue Aug 1, 2015 · 3 comments
Assignees
Labels
Library: SD The SD Arduino library

Comments

@nemeier
Copy link

nemeier commented Aug 1, 2015

In some of my Projects I need to change the SD card. There is a simple allow this. I just require a single line in the SD.c library.

boolean SDClass::begin(uint8_t csPin) {
  /*
    Performs the initialisation required by the sdfatlib library.
    Return true if initialization succeeds, false otherwise.
   */
// ----> Line Added
  if (root.isOpen()) root.close();      // allows repeated calls
// <--- Line Added
  return card.init(SPI_HALF_SPEED, csPin) &&
         volume.init(card) &&
         root.openRoot(volume);
}

After changing the SD card all you need is to reinitialize the sd card.

Will properly solve ISSUE #1103

@facchinm facchinm added the Library: SD The SD Arduino library label Sep 2, 2015
@dzzie
Copy link

dzzie commented Dec 27, 2015

this fixed an issue i was having thanks!

chanalaaa added a commit to thebookgy/Lana-arduino- that referenced this issue Mar 2, 2016
@bborncr
Copy link

bborncr commented Mar 18, 2016

This fix worked for me also. Is there any possible problem that could result from this patch?

@agdl
Copy link
Member

agdl commented Jul 12, 2016

This issue was moved to arduino-libraries/SD#5

@agdl agdl closed this as completed Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Library: SD The SD Arduino library
Projects
None yet
Development

No branches or pull requests

6 participants