summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorCYFS <[email protected]>2024-08-29 06:31:59 +0800
committerGitHub <[email protected]>2024-08-28 18:31:59 -0400
commit4f10d05a5b0c4bd3bd53545e5fff1e05da4729cc (patch)
treee3b0fe198e7fec4a32859c766515e4c277725d58 /bsp
parent53b894c46c8b2c28dfd7f1eccd23ad7e59bf02f0 (diff)
[bsp][ht32] 修复编译问题
修复scons编译问题并添加ci
Diffstat (limited to 'bsp')
-rw-r--r--bsp/ht32/ht32f12366/rtconfig.py2
-rw-r--r--bsp/ht32/ht32f52352/rtconfig.py2
-rw-r--r--bsp/ht32/libraries/HT32_STD_1xxxx_FWLib/SConscript28
-rw-r--r--bsp/ht32/libraries/HT32_STD_5xxxx_FWLib/SConscript29
-rw-r--r--bsp/ht32/tools/sdk_dist.py24
5 files changed, 57 insertions, 28 deletions
diff --git a/bsp/ht32/ht32f12366/rtconfig.py b/bsp/ht32/ht32f12366/rtconfig.py
index 1c3077b6cf..33ae6cc4fa 100644
--- a/bsp/ht32/ht32f12366/rtconfig.py
+++ b/bsp/ht32/ht32f12366/rtconfig.py
@@ -48,7 +48,7 @@ if PLATFORM == 'gcc':
CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
-
+ CFLAGS += ' -D USE_HT32F12365_66'
CPATH = ''
LPATH = ''
diff --git a/bsp/ht32/ht32f52352/rtconfig.py b/bsp/ht32/ht32f52352/rtconfig.py
index 964fa9313e..0525f0267a 100644
--- a/bsp/ht32/ht32f52352/rtconfig.py
+++ b/bsp/ht32/ht32f52352/rtconfig.py
@@ -48,7 +48,7 @@ if PLATFORM == 'gcc':
CFLAGS = DEVICE + ' -Dgcc'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
-
+ CFLAGS += ' -D USE_HT32F52342_52'
CPATH = ''
LPATH = ''
diff --git a/bsp/ht32/libraries/HT32_STD_1xxxx_FWLib/SConscript b/bsp/ht32/libraries/HT32_STD_1xxxx_FWLib/SConscript
index 7e3699bd21..ef04fa4fa9 100644
--- a/bsp/ht32/libraries/HT32_STD_1xxxx_FWLib/SConscript
+++ b/bsp/ht32/libraries/HT32_STD_1xxxx_FWLib/SConscript
@@ -2,11 +2,37 @@ import os
import sys
import rtconfig
from building import *
+
+def get_source(ic_model, file_path, system_path, base_path):
+ source_path = []
+ files_list = []
+ readafter = 0
+ if not os.path.isfile(file_path):
+ return
+
+ with open(file_path, 'r') as file:
+ # content = file.read()
+ for line in file:
+ if readafter == 2 and line.find('>') != -1:
+ break
+ if readafter == 2:
+ files_list.append(line.strip())
+ if line.find(ic_model) != -1:
+ readafter = 1
+ if readafter == 1 and line.find('<') != -1:
+ readafter = 2
+ for line in files_list:
+ if line.find('system') != -1:
+ source_path.append(os.path.join(system_path, line.strip()))
+ else:
+ source_path.append(os.path.join(base_path, line.strip()))
+ return source_path
+
Import('rtconfig')
tools_path = os.path.normpath(os.getcwd() + '../../..' + '/tools')
sys.path.append(tools_path)
-from sdk_dist import get_source
+
source_file_path = os.path.join(os.getcwd(), 'Source_file')
base_path = 'library/HT32F1xxxx_Driver/src/'
diff --git a/bsp/ht32/libraries/HT32_STD_5xxxx_FWLib/SConscript b/bsp/ht32/libraries/HT32_STD_5xxxx_FWLib/SConscript
index 2411aa028f..32e59edc7c 100644
--- a/bsp/ht32/libraries/HT32_STD_5xxxx_FWLib/SConscript
+++ b/bsp/ht32/libraries/HT32_STD_5xxxx_FWLib/SConscript
@@ -2,11 +2,38 @@ import os
import sys
import rtconfig
from building import *
+
+def get_source(ic_model, file_path, system_path, base_path):
+ source_path = []
+ files_list = []
+ readafter = 0
+ if not os.path.isfile(file_path):
+ return
+
+ with open(file_path, 'r') as file:
+ # content = file.read()
+ for line in file:
+ if readafter == 2 and line.find('>') != -1:
+ break
+ if readafter == 2:
+ files_list.append(line.strip())
+ if line.find(ic_model) != -1:
+ readafter = 1
+ if readafter == 1 and line.find('<') != -1:
+ readafter = 2
+ for line in files_list:
+ if line.find('system') != -1:
+ source_path.append(os.path.join(system_path, line.strip()))
+ else:
+ source_path.append(os.path.join(base_path, line.strip()))
+ return source_path
+
+
Import('rtconfig')
tools_path = os.path.normpath(os.getcwd() + '../../..' + '/tools')
sys.path.append(tools_path)
-from sdk_dist import get_source
+
source_file_path = os.path.join(os.getcwd(), 'Source_file')
base_path = 'library/HT32F5xxxx_Driver/src/'
diff --git a/bsp/ht32/tools/sdk_dist.py b/bsp/ht32/tools/sdk_dist.py
index 01540d7ec6..49b2c2872a 100644
--- a/bsp/ht32/tools/sdk_dist.py
+++ b/bsp/ht32/tools/sdk_dist.py
@@ -37,27 +37,3 @@ def dist_do_building(BSP_ROOT, dist_dir):
bsp_update_kconfig_library(dist_dir)
-def get_source(ic_model, file_path, system_path, base_path):
- source_path = []
- files_list = []
- readafter = 0
- if not os.path.isfile(file_path):
- return
-
- with open(file_path, 'r') as file:
- # content = file.read()
- for line in file:
- if readafter == 2 and line.find('>') != -1:
- break
- if readafter == 2:
- files_list.append(line.strip())
- if line.find(ic_model) != -1:
- readafter = 1
- if readafter == 1 and line.find('<') != -1:
- readafter = 2
- for line in files_list:
- if line.find('system') != -1:
- source_path.append(os.path.join(system_path, line.strip()))
- else:
- source_path.append(os.path.join(base_path, line.strip()))
- return source_path