Skip to content

Add SDClass::end function #37

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

Merged
merged 1 commit into from
Nov 9, 2017

Conversation

SodaqMoja
Copy link

Call end function to fully de-initialize SD object. Allows you to call
SD.begin again to init a new card.

This change was taken from Adafruit's SD library.

Author: driverblock rick@embedded-designs.com

src/SD.cpp Outdated
//call this when a card is removed. It will allow you to inster and initialise a new card.
void SDClass::end()
{
root.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since SD.begin() calls SDCARD_SPI.begin();.

I'm wondering if a call to SDCARD_SPI.end(); should be added as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. I'll let others decide.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nobody bothered. Can we just keep it like this?

src/SD.h Outdated
@@ -70,6 +70,9 @@ class SDClass {
boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
boolean begin(uint32_t clock, uint8_t csPin);

//call this when a card is removed. It will allow you to inster and initialise a new card.
Copy link

@jwillemsen jwillemsen Oct 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be insert and not inster

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. But this is the text from the original patch. The typo is like a fingerprint, so you know where it came from.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. If it's desirable to document the source of the code then just add a comment instead of relying on a minor typo that may get fixed in the Adafruit library.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever. I've fixed the typo

Call end function to fully de-initialize SD object. Allows you to call
SD.begin again to init a new card.

This change was taken from Adafruit's SD library.

Author: driverblock <rick@embedded-designs.com>
@SodaqMoja
Copy link
Author

Ping

@cmaglie cmaglie merged commit 5ccc94b into arduino-libraries:master Nov 9, 2017
@cmaglie
Copy link
Contributor

cmaglie commented Nov 9, 2017

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants