Skip to content

SD wrapper: SD.exists() buggy and SD.stop() missing [imported] #19

Closed
@agdl

Description

@agdl

From @cmaglie on November 15, 2012 18:34

This is Issue 465 moved from a Google Code project.
Added by 2011-01-21T14:26:04.000Z by linux-...@o2online.de.
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

I am using the new SD wrapper library and find it very simple and useful.
But the following issues make it unusable in some case:

Let's assume someone needs to remove the SD card from the socket (or disables the power to it when system can go idle) and put the same or another card back to the socket while the system is running, the following problems occur:

  1. it seems that the SD object holds a copy of the FAT because
    SD.exists(someFile) returns true even if there is no SDCard in the socket or
    another one (where this file does NOT exist) is put in. I guess this copy of the FAT won't be refreshed again after SD.begin().

  2. you can not re-initialize the SD-object again. This would be
    necessary (for some SPI magic I guess) if you remove the SDCard from the socket and put it back later. There is no SD.close() or something and calling SD.begin() a second time will always return FALSE and not initialize the SD again.

Issue 1 and 2 could be solved by adding a destructor or a function to
re-initialize the SD object.

Copied from original issue: arduino/Arduino#465

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions