Arduino Forum

Development => Suggestions for the Arduino Project => Topic started by: Utopia on Aug 01, 2011, 11:31 am

Title: SD error codes
Post by: Utopia on Aug 01, 2011, 11:31 am
While testing  my SD card, I had to expose the error code provided by the Sd2Card 'card' in the class SDClass (\SD\SD.h)

Code: [Select]
class SDClass {
...
 Sd2Card card;
...
public:
int error(void)
{
 return card.errorCode();
}


I'd like to suggest this be added to the code, since others might want to know what the error code is when their SD card fails.
Title: Re: SD error codes
Post by: robtillaart on Aug 01, 2011, 02:27 pm
Sounds like a good idea, if all errorcodes are documented, what they mean, cq how to solve (could be in a separate txt file, not in the SDclass)
Title: Re: SD error codes
Post by: Utopia on Aug 02, 2011, 01:29 am

Sounds like a good idea, if all errorcodes are documented, what they mean, cq how to solve (could be in a separate txt file, not in the SDclass)


currently, they are in \libraries\SD\utility\Sd2Card.h starting from line 95, so even the error function as it stands would provide some use/help
Title: Re: SD error codes
Post by: fat16lib on Aug 05, 2011, 03:05 pm
In the beginning I used error codes for debug in SdFat.  They have not been the same from version to version.

Error codes have become useful for diagnosing hardware problems so I plan to implement a error code to text function in a future version of SdFat.

SD.h is a wrapper for an old version of SdFat so this won't help SD.h users.