From 56e7df616173f4c15a9d880eb9bcf0ccc88573b3 Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Wed, 3 May 2017 23:26:39 -0700 Subject: [PATCH] More robust AVR programming --- scripts/avr109-flash.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/avr109-flash.py b/scripts/avr109-flash.py index 7aeb6e0..87b919d 100755 --- a/scripts/avr109-flash.py +++ b/scripts/avr109-flash.py @@ -93,10 +93,12 @@ call(['gpio', '-g', 'write', '27', '1']) time.sleep(0.1) # Sync -send('\x1b') +for i in range(10): send('\x1b') # Flush serial -recv(sp.in_waiting) +try: + recv(sp.in_waiting) +except: pass # Get bootloader ID send('S') -- 2.27.0