瀏覽代碼

Added Sink.boot method

There's no unit test for it because I don't know how it could be tested
in a platform-independent way.
Clara Hobbs 6 年之前
父節點
當前提交
4627f39ed1
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. 6
    0
      pdbuddy/__init__.py

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

@@ -88,6 +88,12 @@ class Sink:
88 88
         """Returns the license text from the PD Buddy Sink"""
89 89
         return self.send_command("license")
90 90
 
91
+    def boot(self):
92
+        """Runs the PD Buddy Sink's DFU bootloader and closes the serial port"""
93
+        self._port.write(b"boot\r\n")
94
+        self._port.flush()
95
+        self.close()
96
+
91 97
     def erase(self):
92 98
         """Synchronously erases all stored configuration from flash"""
93 99
         self.send_command("erase")

Loading…
取消
儲存