From b20119558a4b65469bed116c052047826f0a262c Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 25 May 2023 15:05:04 +0100 Subject: [PATCH] add seek() --- acia.h | 2 +- flash_filer.cpp | 9 +++++++++ flash_filer.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/acia.h b/acia.h index d545852..a2dd3f3 100644 --- a/acia.h +++ b/acia.h @@ -46,6 +46,6 @@ public: static const uint8_t eri = 1 << 7; // enable receive interrupt private: - serialio *_device; + class serialio *_device; }; #endif diff --git a/flash_filer.cpp b/flash_filer.cpp index b44696a..d273a63 100644 --- a/flash_filer.cpp +++ b/flash_filer.cpp @@ -22,6 +22,15 @@ static File file; static Dir dir; #endif +bool flash_filer::seek(uint32_t pos) +{ +#if defined(USE_SD) || defined(USE_SPIFFS) || defined(USE_FS) + _pos = _len = 0; + return file.seek(pos); +#endif + return false; +} + bool flash_filer::start() { #if defined(USE_FS) diff --git a/flash_filer.h b/flash_filer.h index 58ebcfd..5004605 100644 --- a/flash_filer.h +++ b/flash_filer.h @@ -15,6 +15,7 @@ public: bool start(); void stop(); + bool seek(uint32_t pos); uint8_t read() { return _buf[_pos++]; } bool more();