1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Applying adafruit SD updates (available() overful fix).

http://code.google.com/p/arduino/issues/detail?id=595
This commit is contained in:
David A. Mellis 2011-09-09 16:57:00 -04:00
parent f3d8628c5e
commit 5ba38fa9bd
2 changed files with 5 additions and 2 deletions

View File

@ -101,7 +101,10 @@ int File::read(void *buf, uint16_t nbyte) {
int File::available() {
if (! _file) return 0;
return size() - position();
uint32_t n = size() - position();
return n > 0X7FFF ? 0X7FFF : n;
}
void File::flush() {

View File

@ -80,7 +80,7 @@ void setup()
// print the type and size of the first FAT-type volume
long volumesize;
uint32_t volumesize;
Serial.print("\nVolume type is FAT");
Serial.println(volume.fatType(), DEC);
Serial.println();