diff --git a/sdtape.cpp b/sdtape.cpp index 62f7e3e..d5524e1 100644 --- a/sdtape.cpp +++ b/sdtape.cpp @@ -6,6 +6,7 @@ static File file, dir; void sdtape::start(const char *programs) { dir = SD.open(programs); + _pos = _len = 0; } void sdtape::stop() diff --git a/spiram.cpp b/spiram.cpp index 8c03739..843527d 100644 --- a/spiram.cpp +++ b/spiram.cpp @@ -20,18 +20,18 @@ spiram::operator byte() void spiram::checkpoint(Stream &s) { - char buf[Memory::page_size]; + byte buf[Memory::page_size]; for (int i = 0; i < pages(); i++) { spiRam.read_stream(i * 256, buf, sizeof(buf)); - s.write((byte *)buf, sizeof(buf)); + s.write(buf, sizeof(buf)); } } void spiram::restore(Stream &s) { - char buf[Memory::page_size]; + byte buf[Memory::page_size]; for (int i = 0; i < pages(); i++) { - s.readBytes(buf, sizeof(buf)); + s.readBytes((char *)buf, sizeof(buf)); spiRam.write_stream(i * 256, buf, sizeof(buf)); } }