|
32 | 32 | def compile(tmp_dir, sketch, tools_dir, hardware_dir, ide_path, f, args):
|
33 | 33 | cmd = ide_path + '/arduino-builder '
|
34 | 34 | cmd += '-compile -logger=human '
|
| 35 | + cmd += '-build-path "' + tmp_dir + '" ' |
| 36 | + cmd += '-tools "' + ide_path + '/tools-builder" ' |
35 | 37 | if args.library_path:
|
36 | 38 | for lib_dir in args.library_path:
|
37 | 39 | cmd += '-libraries "' + lib_dir + '" '
|
38 |
| - cmd += '-build-path "' + tmp_dir + '" ' |
39 | 40 | cmd += '-hardware "' + ide_path + '/hardware" '
|
40 |
| - cmd += '-hardware ' + hardware_dir + ' ' |
41 |
| - cmd += '-tools "' + ide_path + '/tools-builder" ' |
| 41 | + if args.hardware_dir: |
| 42 | + for hw_dir in args.hardware_dir: |
| 43 | + cmd += '-hardware "' + hw_dir + '" ' |
| 44 | + else: |
| 45 | + cmd += '-hardware "' + hardware_dir + '" ' |
42 | 46 | # Debug=Serial,DebugLevel=Core____
|
43 | 47 | cmd += '-fqbn=esp8266com:esp8266:{board_name}:' \
|
44 | 48 | 'CpuFrequency={cpu_freq},' \
|
@@ -72,6 +76,8 @@ def parse_args():
|
72 | 76 | parser.add_argument('-p', '--build_path', help='Build directory')
|
73 | 77 | parser.add_argument('-l', '--library_path', help='Additional library path',
|
74 | 78 | action='append')
|
| 79 | + parser.add_argument('-d', '--hardware_dir', help='Additional hardware path', |
| 80 | + action='append') |
75 | 81 | parser.add_argument('-b', '--board_name', help='Board name', default='generic')
|
76 | 82 | parser.add_argument('-s', '--flash_size', help='Flash size', default='512K64',
|
77 | 83 | choices=['512K0', '512K64', '1M512', '4M1M', '4M3M'])
|
@@ -111,6 +117,7 @@ def main():
|
111 | 117 | created_tmp_dir = True
|
112 | 118 |
|
113 | 119 | tools_dir = os.path.dirname(os.path.realpath(__file__)) + '/../tools'
|
| 120 | + # this is not the correct hardware folder to add. |
114 | 121 | hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '/../cores'
|
115 | 122 |
|
116 | 123 | output_name = tmp_dir + '/' + os.path.basename(sketch_path) + '.bin'
|
|
0 commit comments