summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-03-17 19:27:47 +0700
committerGitHub <[email protected]>2023-03-17 19:27:47 +0700
commit4d273254b6a9ce8f65dcadb637b2e2b59415a21e (patch)
tree46c80d419889884f13baf8467edb5d363b68b295 /tools
parent16daad81643279ffc951ba11a531877dfee8c872 (diff)
parent6683053f4827b682f51c56ed664e440c0286de80 (diff)
Merge pull request #1961 from hathach/remove-all-submodules
Remove all submodules
Diffstat (limited to 'tools')
-rw-r--r--tools/build_board.py2
-rw-r--r--tools/build_utils.py2
-rw-r--r--tools/get_deps.py28
-rw-r--r--tools/iar_template.ipcf2
-rw-r--r--tools/mksunxi.py2
-rwxr-xr-xtools/pcapng_to_corpus.py10
m---------tools/uf20
-rw-r--r--tools/usb_drivers/tinyusb_win_usbser.inf2
8 files changed, 28 insertions, 20 deletions
diff --git a/tools/build_board.py b/tools/build_board.py
index 4593dafa5..13376d126 100644
--- a/tools/build_board.py
+++ b/tools/build_board.py
@@ -56,7 +56,7 @@ if __name__ == '__main__':
result = pool.starmap(build_utils.build_example, pool_args)
# sum all element of same index (column sum)
result = list(map(sum, list(zip(*result))))
-
+
# add to total result
total_result = list(map(lambda x, y: x + y, total_result, result))
diff --git a/tools/build_utils.py b/tools/build_utils.py
index de9052d2d..d0ef52717 100644
--- a/tools/build_utils.py
+++ b/tools/build_utils.py
@@ -124,4 +124,4 @@ def build_size(make_cmd):
sram_size = int(size_list[1]) + int(size_list[2])
return (flash_size, sram_size)
- return (0, 0) \ No newline at end of file
+ return (0, 0)
diff --git a/tools/get_deps.py b/tools/get_deps.py
index 2d4fcf5de..574e5d089 100644
--- a/tools/get_deps.py
+++ b/tools/get_deps.py
@@ -3,8 +3,17 @@ import subprocess
from pathlib import Path
from multiprocessing import Pool
+# Mandatory Dependencies that is always fetched
# path, url, commit (Alphabet sorted by path)
-deps_list = {
+deps_mandatory = {
+ 'lib/FreeRTOS-Kernel' : ['def7d2df2b0506d3d249334974f51e427c17a41c', 'https://github.com/FreeRTOS/FreeRTOS-Kernel.git' ],
+ 'lib/lwip' : ['159e31b689577dbf69cf0683bbaffbd71fa5ee10', 'https://github.com/lwip-tcpip/lwip.git' ],
+ 'tools/uf2' : ['19615407727073e36d81bf239c52108ba92e7660', 'https://github.com/microsoft/uf2.git' ],
+}
+
+# Optional Dependencies per MCU
+# path, url, commit (Alphabet sorted by path)
+deps_optional = {
'hw/mcu/allwinner' : ['8e5e89e8e132c0fd90e72d5422e5d3d68232b756', 'https://github.com/hathach/allwinner_driver.git' ],
'hw/mcu/bridgetek/ft9xx/ft90x-sdk' : ['91060164afe239fcb394122e8bf9eb24d3194eb1', 'https://github.com/BRTSG-FOSS/ft90x-sdk.git' ],
'hw/mcu/broadcom' : ['08370086080759ed54ac1136d62d2ad24c6fa267', 'https://github.com/adafruit/broadcom-peripherals.git' ],
@@ -55,22 +64,22 @@ deps_list = {
'hw/mcu/ti' : ['143ed6cc20a7615d042b03b21e070197d473e6e5', 'https://github.com/hathach/ti_driver.git' ],
'hw/mcu/wch/ch32v307' : ['17761f5cf9dbbf2dcf665b7c04934188add20082', 'https://github.com/openwch/ch32v307.git' ],
'lib/CMSIS_5' : ['20285262657d1b482d132d20d755c8c330d55c1f', 'https://github.com/ARM-software/CMSIS_5.git' ],
- 'lib/FreeRTOS-Kernel' : ['2a604f4a2818b8354b5e1a39e388eb5e16cfbc1f', 'https://github.com/FreeRTOS/FreeRTOS-Kernel.git' ],
- 'lib/lwip' : ['159e31b689577dbf69cf0683bbaffbd71fa5ee10', 'https://github.com/lwip-tcpip/lwip.git' ],
'lib/sct_neopixel' : ['e73e04ca63495672d955f9268e003cffe168fcd8', 'https://github.com/gsteiert/sct_neopixel.git' ],
- 'tools/uf2' : ['19615407727073e36d81bf239c52108ba92e7660', 'https://github.com/microsoft/uf2.git' ],
}
+# combined 2 deps
+deps_all = {**deps_mandatory, **deps_optional}
+
# TOP is tinyusb root dir
TOP = Path(__file__).parent.parent.resolve()
def get_a_dep(d):
- if d not in deps_list.keys():
+ if d not in deps_all.keys():
print('{} is not found in dependency list')
return 1
- commit = deps_list[d][0]
- url = deps_list[d][1]
+ commit = deps_all[d][0]
+ url = deps_all[d][1]
print('cloning {} with {}'.format(d, url))
p = Path(TOP / d)
@@ -87,6 +96,7 @@ def get_a_dep(d):
head = result.stdout.decode("utf-8").splitlines()[0]
if commit != head:
+ subprocess.run("{} reset --hard".format(git_cmd, commit), shell=True)
subprocess.run("{} fetch --depth 1 origin {}".format(git_cmd, commit), shell=True)
subprocess.run("{} checkout FETCH_HEAD".format(git_cmd), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@@ -95,7 +105,7 @@ def get_a_dep(d):
if __name__ == "__main__":
status = 0
- all_deps = sys.argv[1:]
+ deps = list(deps_mandatory.keys()) + sys.argv[1:]
with Pool() as pool:
- status = sum(pool.map(get_a_dep, all_deps))
+ status = sum(pool.map(get_a_dep, deps))
sys.exit(status)
diff --git a/tools/iar_template.ipcf b/tools/iar_template.ipcf
index ba54fe057..d243aab0a 100644
--- a/tools/iar_template.ipcf
+++ b/tools/iar_template.ipcf
@@ -141,5 +141,5 @@
<path>$TUSB_DIR$/lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_IAR.c</path>
</group>
</files>
-
+
</iarProjectConnection>
diff --git a/tools/mksunxi.py b/tools/mksunxi.py
index 04786f429..fd8557cfc 100644
--- a/tools/mksunxi.py
+++ b/tools/mksunxi.py
@@ -45,4 +45,4 @@ if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: mksunxi.py input.bin output.bin")
exit(1)
- exit(process_file(sys.argv[1], sys.argv[2])) \ No newline at end of file
+ exit(process_file(sys.argv[1], sys.argv[2]))
diff --git a/tools/pcapng_to_corpus.py b/tools/pcapng_to_corpus.py
index 78b1f77a2..9c31365eb 100755
--- a/tools/pcapng_to_corpus.py
+++ b/tools/pcapng_to_corpus.py
@@ -16,7 +16,7 @@ def extract_packets(pcap_file):
def build_corpus_zip(zip_file_output, packets):
"""Builds a zip file with a file per packet
-
+
The structure of this zip corpus is a simple content addressable storage
i.e. seed_file_name == sha256_digest(packet).
"""
@@ -25,7 +25,7 @@ def build_corpus_zip(zip_file_output, packets):
hash = hashlib.sha256(packet).hexdigest()
if hash not in out.namelist():
out.writestr(hash, packet)
-
+
def main(pcap_file, output_zip_file):
packets = extract_packets(pcap_file)
@@ -35,12 +35,10 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog = "pcapng_to_corpus.py",
description="""Converts a wireshark capture to a zip of binary packet
- files suitable for an oss-fuzz corpus. In the case the
- zip corpus already exists, this script will modify
+ files suitable for an oss-fuzz corpus. In the case the
+ zip corpus already exists, this script will modify
the zip file in place adding seed entries.""")
parser.add_argument('pcapng_capture_file')
parser.add_argument('oss_fuzz_corpus_zip')
args = parser.parse_args()
main(args.pcapng_capture_file, args.oss_fuzz_corpus_zip)
-
-
diff --git a/tools/uf2 b/tools/uf2
deleted file mode 160000
-Subproject 19615407727073e36d81bf239c52108ba92e766
diff --git a/tools/usb_drivers/tinyusb_win_usbser.inf b/tools/usb_drivers/tinyusb_win_usbser.inf
index e7f7a9b22..659f048ae 100644
--- a/tools/usb_drivers/tinyusb_win_usbser.inf
+++ b/tools/usb_drivers/tinyusb_win_usbser.inf
@@ -105,4 +105,4 @@ DRIVERFILENAME ="usbser"
MFGNAME="tinyusb.org"
INSTDISK="tinyusb CDC Driver"
DESCRIPTION="tinyusb Serial"
-SERVICE="USB RS-232 Emulation Driver" \ No newline at end of file
+SERVICE="USB RS-232 Emulation Driver"