mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 02:07:55 +00:00
Fileman default open and Screenshot viewer (#1102)
* WIP expensive way * Add default file handling to fileman * Remove screenshot_reader and tests * Read data in chunks * Format * Fix error text position * PR feedback --------- Co-authored-by: kallanreed <kallanreed@outlook.com>
This commit is contained in:
@@ -85,9 +85,13 @@ File::Result<File::Size> File::write(const void* data, Size bytes_to_write) {
|
||||
}
|
||||
}
|
||||
|
||||
File::Offset File::tell() const {
|
||||
return f_tell(&f);
|
||||
}
|
||||
|
||||
File::Result<File::Offset> File::seek(Offset new_position) {
|
||||
/* NOTE: Returns *old* position, not new position */
|
||||
const auto old_position = f_tell(&f);
|
||||
const auto old_position = tell();
|
||||
const auto result = f_lseek(&f, new_position);
|
||||
if (result != FR_OK) {
|
||||
return {static_cast<Error>(result)};
|
||||
|
Reference in New Issue
Block a user