minor updates

This commit is contained in:
steve 2023-10-20 13:01:15 +01:00
parent bfb6b379d0
commit 2c2d8146d2
3 changed files with 36 additions and 26 deletions

3
acia.h
View File

@ -9,6 +9,7 @@ public:
uint8_t read(Memory::address);
ACIA(serialio &s): _serial(&s) {}
void set_device(serialio *s) { _serial = s; }
// status bits
//
@ -55,6 +56,6 @@ protected:
virtual void write_data(uint8_t);
private:
class serialio *_serial;
serialio *_serial;
};
#endif

View File

@ -29,6 +29,38 @@ bool flash_file::seek(uint32_t pos)
#endif
}
bool flash_file::more()
{
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
return files[_fd].available() > 0;
#else
return false;
#endif
}
uint8_t flash_file::read() {
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
return files[_fd].read();
#else
return 0xff;
#endif
}
flash_file::operator bool() const {
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
return files[_fd];
#else
return false;
#endif
}
void flash_file::write(uint8_t b) {
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
files[_fd].write(b);
files[_fd].flush();
#endif
}
bool flash_filer::start()
{
#if defined(USE_LITTLEFS)
@ -50,30 +82,6 @@ void flash_filer::stop()
#endif
}
bool flash_file::more()
{
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
return files[_fd].available() > 0;
#else
return false;
#endif
}
uint8_t flash_file::read() {
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
return files[_fd].read();
#else
return 0xff;
#endif
}
void flash_file::write(uint8_t b) {
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
files[_fd].write(b);
files[_fd].flush();
#endif
}
const char *flash_filer::advance() {
#if defined(USE_SPIFFS) || defined(USE_LITTLEFS)
bool rewound = false;

View File

@ -1,7 +1,7 @@
#ifndef __FLASH_FILER_H__
#define __FLASH_FILER_H__
#define MAX_FILES 3
#define MAX_FILES 5
class flash_file: virtual public serialio {
public:
@ -12,6 +12,7 @@ public:
virtual void write(uint8_t);
bool seek(uint32_t pos);
operator bool() const;
private:
const uint8_t _fd;