Pages: [1]   Go Down
Author Topic: SD error codes  (Read 1397 times)
0 Members and 1 Guest are viewing this topic.
Victoria, BC, Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 222
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12483
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Victoria, BC, Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 222
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Edison Member
*
Karma: 44
Posts: 1485
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Pages: [1]   Go Up
Jump to: