Pages: [1]   Go Down
Author Topic: SD library problem in IDE v1.0 beta-3  (Read 1787 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A little error seems to have cropped up in the latest beta IDE.  In any sketch which uses the SD library, I get the following message:

Quote
C:\Users\Tim\Documents\Arduino\ide\v10b3\libraries\SD\File.cpp: In member function 'virtual size_t File::write(const uint8_t*, size_t)':
C:\Users\Tim\Documents\Arduino\ide\v10b3\libraries\SD\File.cpp:77: error: 'class SdFile' has no member named 'writeError'

This happens even with the example sketches.  Everything is fine with v1.0 beta-2, yet as far as I can see the SD library hasn't changed.  Any ideas?
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5377
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I took a short look at the code. The declaration for writeError is in
/libraries/SD/utility/SDFat.h

If you want to check, look for this. Line 44 in v0022:
Quote
class SdFile : public Print {
 public:
  /** Create an instance of SdFile. */
  SdFile(void) : type_(FAT_FILE_TYPE_CLOSED) {}
  /**
   * writeError is set to true if an error occurs during a write().
   * Set writeError to false before calling print() and/or write() and check
   * for true after calls to print() and/or write().
   */
  bool writeError;

You might want to look there and see if something has changed.
Logged

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

David Mellis is aware of this.

You can comment out the following code at about line 77 of arduino-1.0-beta3/libraries/SD/File.cpp

Code:
/*
  if (_file->writeError()) {
    setWriteError();
    return 0;
  }
*/

The error handling was moved to the write call but his code was not removed.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you just want to change writeError() to getWriteError(), not comment out the code. 
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, glad to hear it's a known problem.  IDE 1.0 is a big improvement over v0022 and I've been using it as much as possible.  Looking forward to the next beta-version.
Logged

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

Changing writeError() to getWriteError() or commenting out the block will give identical results.

The call to SdFat::write() above the block calls setWriteError() and returns zero.
Logged

Pages: [1]   Go Up
Jump to: