Skip to content

Acquire SD card #87

New issue

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

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

Already on GitHub? # to your account

Closed
elpiel opened this issue May 24, 2023 · 7 comments · Fixed by #95
Closed

Acquire SD card #87

elpiel opened this issue May 24, 2023 · 7 comments · Fixed by #95

Comments

@elpiel
Copy link
Contributor

elpiel commented May 24, 2023

I've come to realise that in version 0.5 in order to acquire the SD card you need to call check_init or acquire but it's not exposed from SdCardInner.
Instead you need to call either num_bytes or directly try to read/write to the SD card in order to initialize it.
It would be nice to be able to expose acquire or better the check_init function in SdCard in order to be able to initialize it upfront before the first read/write takes place.

@jonathanpallant
Copy link
Collaborator

In theory any API call will trigger card acquisition. The demos just use num_bytes() because it's a nice one to print out.

@jonathanpallant
Copy link
Collaborator

Ok, I forgot to do it in get_card_type()

@elpiel
Copy link
Contributor Author

elpiel commented May 24, 2023

Yes, it would be nice to have it also in the card type method.
My only concern of the current acquiring card method is that it is implicit.
This needs to be well-documented or have a separate method to initialize the card imo.

I've tested it today and I can't say how much improvement there is, however, new version is working 🙌

@jonathanpallant
Copy link
Collaborator

It's a replacement for the Arduino SDFat library, so keeping it simple is good.

@elpiel
Copy link
Contributor Author

elpiel commented Jun 21, 2023

@jonathanpallant should I close this issue or should I leave it because of the get_card_type()?

@jonathanpallant
Copy link
Collaborator

I opened #90

@elpiel
Copy link
Contributor Author

elpiel commented Jun 21, 2023

Ok, great!
Then we can either close this issue or set it to "documentation needed". I still believe it should be mentioned that it acquires the sd card on first call in the docs.

jonathanpallant added a commit that referenced this issue Sep 15, 2023

Verified

This commit was signed with the committer’s verified signature.
jonathanpallant Jonathan Pallant
Closes #87
Closes #90
jonathanpallant added a commit that referenced this issue Sep 15, 2023

Verified

This commit was signed with the committer’s verified signature.
jonathanpallant Jonathan Pallant
Closes #87
Closes #90
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants