mirror of
https://github.com/jscrane/Apple1.git
synced 2024-11-21 14:32:46 +00:00
add missing files
This commit is contained in:
parent
de511a2346
commit
869ce26a7a
31
terminal_disp.cpp
Normal file
31
terminal_disp.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include <Arduino.h>
|
||||
#include <serial_dsp.h>
|
||||
#include "disp.h"
|
||||
#include "terminal_disp.h"
|
||||
|
||||
void terminal_disp::status(const char *s) {
|
||||
_p.println(s);
|
||||
}
|
||||
|
||||
void terminal_disp::write(uint8_t b) {
|
||||
char c = (char)b;
|
||||
switch(c) {
|
||||
case '_':
|
||||
_p.write(' ');
|
||||
_p.write('\b');
|
||||
_p.write('\b');
|
||||
_p.write('_');
|
||||
_p.write('\b');
|
||||
break;
|
||||
case '\r':
|
||||
_p.write(' ');
|
||||
_p.write('\r');
|
||||
_p.write('\n');
|
||||
break;
|
||||
default:
|
||||
_p.write(b);
|
||||
break;
|
||||
}
|
||||
_p.write('_');
|
||||
_p.write('\b');
|
||||
}
|
17
terminal_disp.h
Normal file
17
terminal_disp.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef __TERMINAL_DISP_H__
|
||||
#define __TERMINAL_DISP_H__
|
||||
|
||||
class terminal_disp: public disp {
|
||||
public:
|
||||
terminal_disp(Print &p): _p(p) {}
|
||||
|
||||
void checkpoint(Stream &) {}
|
||||
void restore(Stream &) {}
|
||||
void status(const char *);
|
||||
void write(uint8_t);
|
||||
|
||||
private:
|
||||
Print &_p;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user