Browse Source

Tweaks to build scripts

Scott Lahteine 3 years ago
parent
commit
903d0b91fc
28 changed files with 77 additions and 37 deletions
  1. 2
    5
      Marlin/src/HAL/LPC1768/upload_extra_script.py
  2. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py
  3. 3
    0
      buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
  4. 3
    0
      buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
  5. 3
    0
      buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
  6. 3
    0
      buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py
  7. 3
    0
      buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py
  8. 4
    0
      buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
  9. 3
    0
      buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
  10. 4
    0
      buildroot/share/PlatformIO/scripts/STM32F401VE_STEVAL.py
  11. 3
    0
      buildroot/share/PlatformIO/scripts/add_nanolib.py
  12. 5
    4
      buildroot/share/PlatformIO/scripts/chitu_crypt.py
  13. 2
    2
      buildroot/share/PlatformIO/scripts/common-cxxflags.py
  14. 1
    3
      buildroot/share/PlatformIO/scripts/common-dependencies.py
  15. 3
    0
      buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py
  16. 4
    5
      buildroot/share/PlatformIO/scripts/download_mks_assets.py
  17. 3
    0
      buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
  18. 4
    0
      buildroot/share/PlatformIO/scripts/fly_mini.py
  19. 4
    0
      buildroot/share/PlatformIO/scripts/lerdge.py
  20. 1
    2
      buildroot/share/PlatformIO/scripts/preflight-checks.py
  21. 4
    0
      buildroot/share/PlatformIO/scripts/random-bin.py
  22. 3
    0
      buildroot/share/PlatformIO/scripts/stm32_bootloader.py
  23. 1
    2
      buildroot/share/scripts/config-labels.py
  24. 1
    2
      buildroot/share/scripts/createTemperatureLookupMarlin.py
  25. 1
    2
      buildroot/share/vscode/auto_build.py
  26. 2
    4
      buildroot/share/vscode/create_custom_upload_command_CDC.py
  27. 1
    2
      buildroot/share/vscode/create_custom_upload_command_DFU.py
  28. 5
    3
      platformio.ini

+ 2
- 5
Marlin/src/HAL/LPC1768/upload_extra_script.py View File

@@ -8,9 +8,7 @@ from __future__ import print_function
8 8
 target_filename = "FIRMWARE.CUR"
9 9
 target_drive = "REARM"
10 10
 
11
-import os
12
-import getpass
13
-import platform
11
+import os,getpass,platform
14 12
 
15 13
 current_OS = platform.system()
16 14
 Import("env")
@@ -33,9 +31,8 @@ try:
33 31
 		#
34 32
 		# platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:'
35 33
 		#   Windows - doesn't care about the disk's name, only cares about the drive letter
36
-		import subprocess
34
+		import subprocess,string
37 35
 		from ctypes import windll
38
-		import string
39 36
 
40 37
 		# getting list of drives
41 38
 		# https://stackoverflow.com/questions/827371/is-there-a-way-to-list-all-the-available-drive-letters-in-python

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/svg2cpp.py View File

@@ -16,7 +16,7 @@
16 16
 # location: <https://www.gnu.org/licenses/>.
17 17
 
18 18
 from __future__ import print_function
19
-import argparse, re, sys
19
+import argparse,re,sys
20 20
 
21 21
 usage = '''
22 22
 This program extracts line segments from a SVG file and writes

+ 3
- 0
buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# STM32F103RC_MEEB_3DP.py
3
+#
1 4
 try:
2 5
     import configparser
3 6
 except ImportError:

+ 3
- 0
buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# STM32F103RC_SKR_MINI.py
3
+#
1 4
 import os
2 5
 Import("env")
3 6
 

+ 3
- 0
buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# STM32F103RC_fysetc.py
3
+#
1 4
 import os
2 5
 from os.path import join
3 6
 from os.path import expandvars

buildroot/share/PlatformIO/scripts/creality.py → buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# STM32F103RET6_creality.py
3
+#
1 4
 import os
2 5
 Import("env")
3 6
 

+ 3
- 0
buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# STM32F103RE_SKR_E3_DIP.py
3
+#
1 4
 import os
2 5
 Import("env")
3 6
 

+ 4
- 0
buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py View File

@@ -1,3 +1,7 @@
1
+#
2
+# STM32F103VE_longer.py
3
+# Customizations for env:STM32F103VE_longer
4
+#
1 5
 import os
2 6
 Import("env")
3 7
 

+ 3
- 0
buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# STM32F1_create_variant.py
3
+#
1 4
 import os,shutil
2 5
 from SCons.Script import DefaultEnvironment
3 6
 from platformio import util

buildroot/share/PlatformIO/scripts/STEVAL__F401XX.py → buildroot/share/PlatformIO/scripts/STM32F401VE_STEVAL.py View File

@@ -1,3 +1,7 @@
1
+#
2
+# STM32F401VE_STEVAL.py
3
+# Customizations for env:STM32F401VE_STEVAL
4
+#
1 5
 import os
2 6
 Import("env")
3 7
 

+ 3
- 0
buildroot/share/PlatformIO/scripts/add_nanolib.py View File

@@ -1,2 +1,5 @@
1
+#
2
+# add_nanolib.py
3
+#
1 4
 Import("env")
2 5
 env.Append(LINKFLAGS=["--specs=nano.specs"])

+ 5
- 4
buildroot/share/PlatformIO/scripts/chitu_crypt.py View File

@@ -1,8 +1,9 @@
1
+#
2
+# chitu_crypt.py
3
+# Customizations for Chitu boards
4
+#
1 5
 Import("env")
2
-import os
3
-import random
4
-import struct
5
-import uuid
6
+import os,random,struct,uuid
6 7
 
7 8
 # Relocate firmware from 0x08000000 to 0x08008800
8 9
 env['CPPDEFINES'].remove(("VECT_TAB_ADDR", "0x8000000"))

+ 2
- 2
buildroot/share/PlatformIO/scripts/common-cxxflags.py View File

@@ -28,8 +28,8 @@ def add_cpu_freq():
28 28
 if env.GetBuildType() == "debug":
29 29
 	env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug'
30 30
 
31
-# On some platform, F_CPU is a runtime variable. Since it's used to convert from ns
32
-# to CPU cycles, this adds overhead preventing small delay (in the order of less than
31
+# On some platform, F_CPU is a runtime variable. Since it's used to convert from ns 
32
+# to CPU cycles, this adds overhead preventing small delay (in the order of less than 
33 33
 # 30 cycles) to be generated correctly. By using a compile time constant instead
34 34
 # the compiler will perform the computation and this overhead will be avoided
35 35
 add_cpu_freq()

+ 1
- 3
buildroot/share/PlatformIO/scripts/common-dependencies.py View File

@@ -2,9 +2,7 @@
2 2
 # common-dependencies.py
3 3
 # Convenience script to check dependencies and add libs and sources for Marlin Enabled Features
4 4
 #
5
-import subprocess
6
-import os
7
-import re
5
+import subprocess,os,re
8 6
 try:
9 7
 	import configparser
10 8
 except ImportError:

+ 3
- 0
buildroot/share/PlatformIO/scripts/copy_marlin_variant_to_framework.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# copy_marlin_variant_to_framework.py
3
+#
1 4
 import os,shutil
2 5
 from SCons.Script import DefaultEnvironment
3 6
 from platformio import util

+ 4
- 5
buildroot/share/PlatformIO/scripts/download_mks_assets.py View File

@@ -1,9 +1,8 @@
1
+#
2
+# download_mks_assets.py
3
+#
1 4
 Import("env")
2
-import os
3
-import requests
4
-import zipfile
5
-import tempfile
6
-import shutil
5
+import os,requests,zipfile,tempfile,shutil
7 6
 
8 7
 url = "https://github.com/makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware/archive/master.zip"
9 8
 zip_path = os.path.join(env.Dictionary("PROJECT_LIBDEPS_DIR"), "mks-assets.zip")

+ 3
- 0
buildroot/share/PlatformIO/scripts/fix_framework_weakness.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# fix_framework_weakness.py
3
+#
1 4
 from os.path import join, isfile
2 5
 import shutil
3 6
 from pprint import pprint

+ 4
- 0
buildroot/share/PlatformIO/scripts/fly_mini.py View File

@@ -1,3 +1,7 @@
1
+#
2
+# fly_mini.py
3
+# Customizations for env:FLY_MINI
4
+#
1 5
 import os
2 6
 Import("env")
3 7
 

+ 4
- 0
buildroot/share/PlatformIO/scripts/lerdge.py View File

@@ -1,3 +1,7 @@
1
+#
2
+# lerdge.py
3
+# Customizations for Lerdge build environments
4
+#
1 5
 import os,sys
2 6
 Import("env")
3 7
 

+ 1
- 2
buildroot/share/PlatformIO/scripts/preflight-checks.py View File

@@ -2,8 +2,7 @@
2 2
 # preflight-checks.py
3 3
 # Check for common issues prior to compiling
4 4
 #
5
-import os
6
-import re
5
+import os,re
7 6
 Import("env")
8 7
 
9 8
 def get_envs_for_board(board):

+ 4
- 0
buildroot/share/PlatformIO/scripts/random-bin.py View File

@@ -1,3 +1,7 @@
1
+#
2
+# random-bin.py
3
+# Set a unique firmware name based on current date and time
4
+#
1 5
 Import("env")
2 6
 
3 7
 from datetime import datetime

+ 3
- 0
buildroot/share/PlatformIO/scripts/stm32_bootloader.py View File

@@ -1,3 +1,6 @@
1
+#
2
+# stm32_bootloader.py
3
+#
1 4
 import os,sys,shutil
2 5
 Import("env")
3 6
 

+ 1
- 2
buildroot/share/scripts/config-labels.py View File

@@ -22,8 +22,7 @@
22 22
 # 2020-06-05 SRL style tweaks
23 23
 #-----------------------------------
24 24
 #
25
-import sys
26
-import os
25
+import sys,os
27 26
 from pathlib import Path
28 27
 from distutils.dir_util import copy_tree  # for copy_tree, because shutil.copytree can't handle existing files, dirs
29 28
 

+ 1
- 2
buildroot/share/scripts/createTemperatureLookupMarlin.py View File

@@ -22,8 +22,7 @@ from __future__ import print_function
22 22
 from __future__ import division
23 23
 
24 24
 from math import *
25
-import sys
26
-import getopt
25
+import sys,getopt
27 26
 
28 27
 "Constants"
29 28
 ZERO   = 273.15                             # zero point of Kelvin scale

+ 1
- 2
buildroot/share/vscode/auto_build.py View File

@@ -72,8 +72,7 @@
72 72
 from __future__ import print_function
73 73
 from __future__ import division
74 74
 
75
-import sys
76
-import os
75
+import sys,os
77 76
 
78 77
 pwd = os.getcwd()  # make sure we're executing from the correct directory level
79 78
 pwd = pwd.replace('\\', '/')

+ 2
- 4
buildroot/share/vscode/create_custom_upload_command_CDC.py View File

@@ -13,11 +13,9 @@
13 13
 from __future__ import print_function
14 14
 from __future__ import division
15 15
 
16
-import subprocess
17
-import os
18
-import sys
16
+import subprocess,os,sys,platform
19 17
 from SCons.Script import DefaultEnvironment
20
-import platform
18
+
21 19
 current_OS = platform.system()
22 20
 
23 21
 env = DefaultEnvironment()

+ 1
- 2
buildroot/share/vscode/create_custom_upload_command_DFU.py View File

@@ -9,8 +9,7 @@
9 9
 #  Will continue on if a COM port isn't found so that the compilation can be done.
10 10
 #
11 11
 
12
-import os
13
-import sys
12
+import os,sys
14 13
 from SCons.Script import DefaultEnvironment
15 14
 import platform
16 15
 current_OS = platform.system()

+ 5
- 3
platformio.ini View File

@@ -1155,7 +1155,7 @@ extends         = env:STM32F103RE
1155 1155
 build_flags     = ${env:STM32F103RE.build_flags} -DTEMP_TIMER_CHAN=4
1156 1156
 extra_scripts   = ${env:STM32F103RE.extra_scripts}
1157 1157
   pre:buildroot/share/PlatformIO/scripts/random-bin.py
1158
-  buildroot/share/PlatformIO/scripts/creality.py
1158
+  buildroot/share/PlatformIO/scripts/STM32F103RET6_creality.py
1159 1159
 debug_tool      = jlink
1160 1160
 upload_protocol = jlink
1161 1161
 
@@ -1194,7 +1194,7 @@ build_flags       = ${common_stm32.build_flags}
1194 1194
   -DDISABLE_GENERIC_SERIALUSB -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
1195 1195
 extra_scripts     = ${common.extra_scripts}
1196 1196
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
1197
-  buildroot/share/PlatformIO/scripts/STEVAL__F401XX.py
1197
+  buildroot/share/PlatformIO/scripts/STM32F401VE_STEVAL.py
1198 1198
 
1199 1199
 #
1200 1200
 # STM32F401RC
@@ -1569,7 +1569,9 @@ board_build.ldscript = ldscript.ld
1569 1569
 board_build.offset   = 0x10000
1570 1570
 build_flags          = ${common_stm32.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
1571 1571
 build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
1572
-extra_scripts        = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/stm32_bootloader.py
1572
+extra_scripts        = ${common.extra_scripts}
1573
+  pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
1574
+  buildroot/share/PlatformIO/scripts/stm32_bootloader.py
1573 1575
 
1574 1576
 #################################
1575 1577
 #                               #

Loading…
Cancel
Save