瀏覽代碼

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 7 年之前
父節點
當前提交
a6c566691a
共有 1 個檔案被更改,包括 5 行新增0 行删除
  1. 5
    0
      pdbuddy/__init__.py

+ 5
- 0
pdbuddy/__init__.py 查看文件

@@ -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…
取消
儲存