Explorar el Código

Send ^D when a connection is made

This removes any garbage that the Sink may have in its buffer, e.g.
partially entered commands or nonsense that appeared when moving the
device to/from a VM.
Clara Hobbs hace 7 años
padre
commit
a6c566691a
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5
    0
      pdbuddy/__init__.py

+ 5
- 0
pdbuddy/__init__.py Ver fichero

@@ -29,6 +29,11 @@ class Sink:
29 29
         except ValueError:
30 30
             self._port = serial.Serial(sp.device, baudrate=115200)
31 31
 
32
+        # Put communications in a known state, cancelling any partially-entered
33
+        # command that may be sitting in the buffer.
34
+        self._port.write("\x04".encode("utf-8"))
35
+        self._port.flush()
36
+
32 37
     def __enter__(self):
33 38
         return self
34 39
 

Loading…
Cancelar
Guardar