r65emu/serial_filer.cpp

37 lines
567 B
C++
Raw Normal View History

2019-02-12 18:19:09 +00:00
#include <Arduino.h>
#include <stdint.h>
#include "hardware.h"
#include "serialio.h"
#include "filer.h"
#include "serial_filer.h"
bool serial_filer::start(const char *) {
2019-02-12 21:53:03 +00:00
#if defined(TERM_SPEED)
2019-02-12 18:19:09 +00:00
Serial.begin(TERM_SPEED);
return true;
2019-02-12 21:53:03 +00:00
#else
return false;
#endif
2019-02-12 18:19:09 +00:00
}
void serial_filer::write(uint8_t b) {
Serial.write(b);
}
uint8_t serial_filer::read() {
return Serial.read();
}
bool serial_filer::more() {
return Serial.available() > 0;
}
const char *serial_filer::checkpoint() {
2019-02-12 21:53:03 +00:00
// FIXME
2019-02-12 18:19:09 +00:00
return 0;
}
void serial_filer::restore(const char *) {
2019-02-12 21:53:03 +00:00
// FIXME
2019-02-12 18:19:09 +00:00
}