chiark / gitweb /
Flush the in/output before programming firmware.
authordaid <daid303@gmail.com>
Tue, 25 Feb 2014 10:17:05 +0000 (11:17 +0100)
committerdaid <daid303@gmail.com>
Tue, 25 Feb 2014 10:17:05 +0000 (11:17 +0100)
Cura/avr_isp/stk500v2.py

index e64e15486e0dc33c371cae805e46903b9edb57b8..56a2223fef4ee78604d80d102f0bf680a61c127b 100644 (file)
@@ -34,6 +34,8 @@ class Stk500v2(ispBase.IspBase):
                self.serial.setDTR(0)
                time.sleep(0.2)
 
+               self.serial.flushInput()
+               self.serial.flushOutput()
                self.sendMessage([1])
                if self.sendMessage([0x10, 0xc8, 0x64, 0x19, 0x20, 0x00, 0x53, 0x03, 0xac, 0x53, 0x00, 0x00]) != [0x10, 0x00]:
                        self.close()