|
|
@ -68,12 +68,19 @@ impl SerialPort {
|
|
|
|
impl Write for SerialPort {
|
|
|
|
impl Write for SerialPort {
|
|
|
|
fn write_str(&mut self, s: &str) -> Result {
|
|
|
|
fn write_str(&mut self, s: &str) -> Result {
|
|
|
|
for c in s.bytes() {
|
|
|
|
for c in s.bytes() {
|
|
|
|
if c == 127 {
|
|
|
|
match c {
|
|
|
|
self.putchar(8);
|
|
|
|
127 => {
|
|
|
|
self.putchar(b' ');
|
|
|
|
self.putchar(8);
|
|
|
|
self.putchar(8);
|
|
|
|
self.putchar(b' ');
|
|
|
|
} else {
|
|
|
|
self.putchar(8);
|
|
|
|
self.putchar(c);
|
|
|
|
},
|
|
|
|
|
|
|
|
b'\n' => {
|
|
|
|
|
|
|
|
self.putchar(b'\r');
|
|
|
|
|
|
|
|
self.putchar(b'\n');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
c => {
|
|
|
|
|
|
|
|
self.putchar(c);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
|