Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Commit 3a1946e

Browse files
committed
Fix seeking in SmallFS
1 parent ab0f702 commit 3a1946e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

hardware/zpuino/zpu20/libraries/SmallFS/SmallFS.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ int SmallFSFile::readCallback(int s, void (*callback)(unsigned char, void*), voi
324324
return save_s;
325325
}
326326

327-
void SmallFSFile::seek(int pos, int whence)
327+
int SmallFSFile::seek(int pos, int whence)
328328
{
329329
int newpos;
330330

@@ -343,6 +343,8 @@ void SmallFSFile::seek(int pos, int whence)
343343

344344
seekpos=newpos;
345345
SmallFS.seek(seekpos + flashoffset);
346+
347+
return newpos;
346348
}
347349

348350
void SmallFS_class::loadSketch(const char *name)

hardware/zpuino/zpu20/libraries/SmallFS/SmallFS.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class SmallFSFile
6464
* @param pos The required position
6565
* @param whence Where to perform seek. Either SEEK_SET, SEEK_CUR or SEEK_END
6666
*/
67-
void seek(int pos, int whence);
67+
int seek(int pos, int whence);
6868
/**
6969
* @brief Get the file size.
7070
* @return The file size.

0 commit comments

Comments
 (0)