We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5e9d53 commit fe6295eCopy full SHA for fe6295e
libraries/Bridge/src/FileIO.cpp
@@ -137,7 +137,21 @@ int File::available() {
137
void File::flush() {
138
}
139
140
-//int read(void *buf, uint16_t nbyte)
+int File::read(void *buff, uint16_t nbyte) {
141
+ uint16_t n = 0;
142
+ uint8_t *p = reinterpret_cast<uint8_t *>(buff);
143
+ while (n < nbyte) {
144
+ if (buffered == 0) {
145
+ doBuffer();
146
+ if (buffered == 0)
147
+ break;
148
+ }
149
+ *p++ = buffer[readPos++];
150
+ buffered--;
151
+ n++;
152
153
+ return n;
154
+}
155
156
uint32_t File::size() {
157
if (bridge.getBridgeVersion() < 101)
0 commit comments