Skip to content

Commit

Permalink
add option to define hardware folder as parameter (esp8266#2230)
Browse files Browse the repository at this point in the history
current hardware folder used for the core is wrong, but I have not come
up with a way to properly configure it
  • Loading branch information
me-no-dev authored and igrr committed Jul 5, 2016
1 parent 7a2d246 commit 79ce122
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@
def compile(tmp_dir, sketch, tools_dir, hardware_dir, ide_path, f, args):
cmd = ide_path + '/arduino-builder '
cmd += '-compile -logger=human '
cmd += '-build-path "' + tmp_dir + '" '
cmd += '-tools "' + ide_path + '/tools-builder" '
if args.library_path:
for lib_dir in args.library_path:
cmd += '-libraries "' + lib_dir + '" '
cmd += '-build-path "' + tmp_dir + '" '
cmd += '-hardware "' + ide_path + '/hardware" '
cmd += '-hardware ' + hardware_dir + ' '
cmd += '-tools "' + ide_path + '/tools-builder" '
if args.hardware_dir:
for hw_dir in args.hardware_dir:
cmd += '-hardware "' + hw_dir + '" '
else:
cmd += '-hardware "' + hardware_dir + '" '
# Debug=Serial,DebugLevel=Core____
cmd += '-fqbn=esp8266com:esp8266:{board_name}:' \
'CpuFrequency={cpu_freq},' \
Expand Down Expand Up @@ -72,6 +76,8 @@ def parse_args():
parser.add_argument('-p', '--build_path', help='Build directory')
parser.add_argument('-l', '--library_path', help='Additional library path',
action='append')
parser.add_argument('-d', '--hardware_dir', help='Additional hardware path',
action='append')
parser.add_argument('-b', '--board_name', help='Board name', default='generic')
parser.add_argument('-s', '--flash_size', help='Flash size', default='512K64',
choices=['512K0', '512K64', '1M512', '4M1M', '4M3M'])
Expand Down Expand Up @@ -111,6 +117,7 @@ def main():
created_tmp_dir = True

tools_dir = os.path.dirname(os.path.realpath(__file__)) + '/../tools'
# this is not the correct hardware folder to add.
hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '/../cores'

output_name = tmp_dir + '/' + os.path.basename(sketch_path) + '.bin'
Expand Down

0 comments on commit 79ce122

Please sign in to comment.