Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit92d12a7

Browse files
committed
Add script to update HAL drivers and CMSIS devices
from STM32cube released on GitHubSigned-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent506d261 commit92d12a7

File tree

3 files changed

+576
-0
lines changed

3 files changed

+576
-0
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ astyle.out
33
boards.local.txt
44
platform.local.txt
55
path_config.json
6+
update_config.json
67

78
# Backup
89
*.bak

‎CI/utils/stm32common.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
importos
2+
importre
3+
importshutil
4+
5+
6+
# Create a folder if not exists
7+
defcreateFolder(path):
8+
try:
9+
ifnotos.path.exists(path):
10+
os.makedirs(path)
11+
exceptOSError:
12+
print("Error: Creating directory. "+path)
13+
14+
15+
# Delete targeted folder recursively
16+
defdeleteFolder(path):
17+
ifos.path.isdir(path):
18+
shutil.rmtree(path,ignore_errors=True)
19+
20+
21+
# copy src folder recursively to dest
22+
defcopyFolder(src,dest,ign_patt=set()):
23+
try:
24+
ifos.path.isdir(src):
25+
shutil.copytree(src,dest,ignore=shutil.ignore_patterns(*ign_patt))
26+
exceptOSErrorase:
27+
print("Error: Folder %s not copied. %s"%src,e)
28+
29+
30+
defgenSTM32List(path,pattern):
31+
stm32_list= []# Serie
32+
dir_pattern=re.compile("^STM32(.*)xx_HAL_Driver$",re.IGNORECASE)
33+
34+
ifpatternisnotNone:
35+
serie_pattern=re.compile(pattern,re.IGNORECASE)
36+
else:
37+
serie_pattern=re.compile(".*",re.IGNORECASE)
38+
39+
forfileinos.listdir(path):
40+
res=dir_pattern.match(file)
41+
ifresandserie_pattern.search(res.group(1)):
42+
stm32_list.append(res.group(1))
43+
stm32_list.sort()
44+
returnstm32_list

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp