Browse Source

Enable local board repository for PIO (#11079)

-Enable boards_dir option in PIO INI
-Remove defunct custom board file operations for PIO auto-build environment
-Remove now-defunct Teensy++ 2.0 PIO entry, replaced by `at90USB1286_DFU` and `at90USB1286_DFU` (using this entry always put AT90USB board boot loaders in jeopardy of being overwritten due to the very small size of the official Teensy++ 2.0 bootloader)
-whitespace
Dave Johnson 6 years ago
parent
commit
3b7c5a31a3
2 changed files with 3 additions and 56 deletions
  1. 0
    42
      buildroot/share/atom/auto_build.py
  2. 3
    14
      platformio.ini

+ 0
- 42
buildroot/share/atom/auto_build.py View File

412
 # end - open_file
412
 # end - open_file
413
 
413
 
414
 
414
 
415
-#
416
-# move custom board definitions from project folder to PlatformIO
417
-#
418
-def copy_boards_dir():
419
-
420
-        temp = os.environ
421
-        for key in temp:
422
-          if 0 <=  os.environ[key].find('.platformio'):
423
-            part = os.environ[key].split(';')
424
-            for part2 in part:
425
-              if 0 <=  part2.find('.platformio'):
426
-                path = part2
427
-                break
428
-
429
-        PIO_path = path[ : path.find('.platformio') + 11]
430
-
431
-#         import sys
432
-#         import subprocess
433
-#         pio_subprocess = subprocess.Popen(['platformio', 'run', '-t', 'envdump'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
434
-#
435
-#         # stream output from subprocess and split it into lines
436
-#         for line in iter(pio_subprocess.stdout.readline, ''):
437
-#             if 0 <= line.find('PIOHOME_DIR'):
438
-#               start = line.find(':') + 3
439
-#               end =  line.find(',') - 1
440
-#               PIO_path = line[start:end]
441
-
442
-
443
-        PIO_path =  PIO_path.replace("\\", "/")
444
-        PIO_path =  PIO_path.replace("//", "/") + '/boards'
445
-
446
-        board_path = 'buildroot/share/PlatformIO/boards'
447
-
448
-        from distutils.dir_util import copy_tree
449
-        copy_tree(board_path, PIO_path)
450
-
451
-# end copy_boards_dir
452
-
453
-
454
 # gets the last build environment
415
 # gets the last build environment
455
 def get_build_last():
416
 def get_build_last():
456
       env_last = ''
417
       env_last = ''
1265
         os.environ["BOARD_NAME"] = board_name
1226
         os.environ["BOARD_NAME"] = board_name
1266
 
1227
 
1267
         auto_build = output_window()
1228
         auto_build = output_window()
1268
-        if 0 <= target_env.find('USB1286'):
1269
-            copy_boards_dir()          # copy custom boards over to PlatformIO if using custom board
1270
-                                       #    causes 3-5 second delay in main window appearing
1271
         auto_build.start_thread()  # executes the "run_PIO" function
1229
         auto_build.start_thread()  # executes the "run_PIO" function
1272
 
1230
 
1273
         auto_build.root.mainloop()
1231
         auto_build.root.mainloop()

+ 3
- 14
platformio.ini View File

20
 build_dir   = .pioenvs
20
 build_dir   = .pioenvs
21
 lib_dir     = .piolib
21
 lib_dir     = .piolib
22
 libdeps_dir = .piolibdeps
22
 libdeps_dir = .piolibdeps
23
+boards_dir  = buildroot/share/PlatformIO/boards
23
 env_default = megaatmega2560
24
 env_default = megaatmega2560
24
 
25
 
25
 [common]
26
 [common]
89
 lib_ldf_mode  = deep+
90
 lib_ldf_mode  = deep+
90
 src_filter    = ${common.default_src_filter}
91
 src_filter    = ${common.default_src_filter}
91
 extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_CDC.py
92
 extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_CDC.py
93
+monitor_speed = 250000
92
 
94
 
93
 #
95
 #
94
 # AT90USB1286 boards using DFU bootloader
96
 # AT90USB1286 boards using DFU bootloader
105
 lib_ldf_mode  = deep+
107
 lib_ldf_mode  = deep+
106
 src_filter    = ${common.default_src_filter}
108
 src_filter    = ${common.default_src_filter}
107
 extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_DFU.py
109
 extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_DFU.py
110
+monitor_speed = 250000
108
 
111
 
109
 #
112
 #
110
 # Due (Atmel SAM3X8E ARM Cortex-M3)
113
 # Due (Atmel SAM3X8E ARM Cortex-M3)
272
 monitor_speed = 250000
275
 monitor_speed = 250000
273
 
276
 
274
 #
277
 #
275
-# Teensy++ 2.0
276
-#
277
-[env:teensy20]
278
-platform          = teensy
279
-framework         = arduino
280
-board             = teensy20pp
281
-build_flags       = ${common.build_flags}
282
-#board_build.f_cpu = 20000000L     ; Bug in Arduino framework disallows boards running at 20Mhz
283
-lib_deps          = ${common.lib_deps}
284
-lib_ldf_mode      = deep+
285
-src_filter        = ${common.default_src_filter}
286
-monitor_speed     = 250000
287
-
288
-#
289
 # Teensy 3.5 / 3.6 (ARM Cortex-M4)
278
 # Teensy 3.5 / 3.6 (ARM Cortex-M4)
290
 #
279
 #
291
 [env:teensy35]
280
 [env:teensy35]

Loading…
Cancel
Save