Sfoglia il codice sorgente

Fix File.read()

teensy4-core
PaulStoffregen 4 anni fa
parent
commit
928017fba3
2 ha cambiato i file con 12 aggiunte e 6 eliminazioni
  1. +6
    -3
      teensy3/FS.h
  2. +6
    -3
      teensy4/FS.h

+ 6
- 3
teensy3/FS.h Vedi File

@@ -95,9 +95,6 @@ public:
virtual int available() {
return (f) ? f->available() : 0;
}
virtual int read() {
return (f) ? f->read() : -1;
}
virtual int peek() {
return (f) ? f->peek() : -1;
}
@@ -134,6 +131,12 @@ public:
bool seek(uint32_t pos) {
return seek(pos, SeekSet);
}
int read() {
if (!f) return -1;
unsigned char b;
if (f->read(&b, 1) < 1) return -1;
return b;
}
size_t write(uint8_t b) {
return write(&b, 1);
}

+ 6
- 3
teensy4/FS.h Vedi File

@@ -95,9 +95,6 @@ public:
virtual int available() {
return (f) ? f->available() : 0;
}
virtual int read() {
return (f) ? f->read() : -1;
}
virtual int peek() {
return (f) ? f->peek() : -1;
}
@@ -134,6 +131,12 @@ public:
bool seek(uint32_t pos) {
return seek(pos, SeekSet);
}
int read() {
if (!f) return -1;
unsigned char b;
if (f->read(&b, 1) < 1) return -1;
return b;
}
size_t write(uint8_t b) {
return write(&b, 1);
}

Loading…
Annulla
Salva