Ver código fonte

Fix File.read()

main
PaulStoffregen 4 anos atrás
pai
commit
928017fba3
2 arquivos alterados com 12 adições e 6 exclusões
  1. +6
    -3
      teensy3/FS.h
  2. +6
    -3
      teensy4/FS.h

+ 6
- 3
teensy3/FS.h Ver arquivo

@@ -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 Ver arquivo

@@ -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);
}

Carregando…
Cancelar
Salvar