Avoid errors when "upload speed" and "upload protocol" are missed in board definition file

This commit is contained in:
Ivan Kravets
2015-02-12 13:26:37 +02:00
committed by Valeriy Koval
parent 3179e90aea
commit f9ec259742
2 changed files with 5 additions and 3 deletions

View File

@ -560,5 +560,5 @@
"use_1200bps_touch": true,
"wait_for_upload_port": false
}
}
}
}

View File

@ -81,9 +81,11 @@ if "BOARD" in env:
if "BOARD_F_CPU" not in env:
env.Replace(BOARD_F_CPU="${BOARD_OPTIONS['build']['f_cpu']}")
if "UPLOAD_PROTOCOL" not in env:
env.Replace(UPLOAD_PROTOCOL="${BOARD_OPTIONS['upload']['protocol']}")
env.Replace(
UPLOAD_PROTOCOL="${BOARD_OPTIONS['upload'].get('protocol', None)}")
if "UPLOAD_SPEED" not in env:
env.Replace(UPLOAD_SPEED="${BOARD_OPTIONS['upload']['speed']}")
env.Replace(
UPLOAD_SPEED="${BOARD_OPTIONS['upload'].get('speed', None)}")
if "IGNORE_LIBS" in env:
env['IGNORE_LIBS'] = [l.strip() for l in env['IGNORE_LIBS'].split(",")]