mirror of
https://github.com/sipeed/Maixduino.git
synced 2026-03-13 05:26:59 +01:00
add KPU and mobilenet demo, fix LCD bug
This commit is contained in:
@@ -95,6 +95,22 @@ int File::read(void *buf, uint16_t nbyte) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
long File::read(void *buf, uint32_t nbyte) {
|
||||
if (!_file)
|
||||
return 0;
|
||||
uint32_t bytesToRead = nbyte;
|
||||
uint16_t ret, readBytesOnece;
|
||||
while(bytesToRead)
|
||||
{
|
||||
readBytesOnece = (bytesToRead>65000) ? 65000 : bytesToRead;
|
||||
ret = (uint16_t)_file->read(buf+(nbyte-bytesToRead), readBytesOnece);
|
||||
if(ret == 0xffff)
|
||||
return -1;
|
||||
bytesToRead -= ret;
|
||||
}
|
||||
return nbyte;
|
||||
}
|
||||
|
||||
int File::available() {
|
||||
if (! _file) return 0;
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
virtual int available();
|
||||
virtual void flush();
|
||||
int read(void *buf, uint16_t nbyte);
|
||||
long read(void *buf, uint32_t nbyte);
|
||||
boolean seek(uint32_t pos);
|
||||
uint32_t position();
|
||||
uint32_t size();
|
||||
|
||||
Reference in New Issue
Block a user