Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Commit

Permalink
fix: support Leonardo, Yun and derivatives upload with IDE 1.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrkv committed Apr 15, 2014
1 parent ef1f6da commit 0db2b4b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ino/commands/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ def run(self, args):
# this wait a moment for the bootloader to enumerate. On Windows, also must
# deal with the fact that the COM port number changes from bootloader to
# sketch.
if board['bootloader']['path'] == "caterina":
caterina_port = None
touch_port = \
board['upload'].get('use_1200bps_touch') == 'true' or \
board['upload']['protocol'] == 'avr109'

if touch_port:
new_port = None
before = self.e.list_serial_ports()
if port in before:

This comment has been minimized.

Copy link
@siemanko

siemanko May 30, 2014

Not sure what is the purpose of this check but for my Arduino Leonardo it fails even though it shouldn't. Removing that if fixes everything! (ubuntu 12.10 - I do not support ubuntu - they made me :( - Fedora rulezzzzz!).

Szymon

ser = Serial()
Expand All @@ -106,20 +110,20 @@ def run(self, args):
now = self.e.list_serial_ports()
diff = list(set(now) - set(before))
if diff:
caterina_port = diff[0]
new_port = diff[0]
break

before = now
sleep(enum_delay)
elapsed += enum_delay

if caterina_port == None:
raise Abort("Couldn’t find a Leonardo on the selected port. "
if not new_port:
raise Abort("Couldn’t find a board on the selected port. "
"Check that you have the correct port selected. "
"If it is correct, try pressing the board's reset "
"button after initiating the upload.")

port = caterina_port
port = new_port

# call avrdude to upload .hex
subprocess.call([
Expand Down

0 comments on commit 0db2b4b

Please sign in to comment.