@@ -122,7 +122,7 @@ def bsp_update_kconfig(dist_dir):
122122 line = line [0 :position ] + 'default "rt-thread"\n '
123123 found = 0
124124 f .write (line )
125-
125+
126126def bsp_update_kconfig_library (dist_dir ):
127127 # change RTT_ROOT in Kconfig
128128 if not os .path .isfile (os .path .join (dist_dir , 'Kconfig' )):
@@ -141,7 +141,7 @@ def bsp_update_kconfig_library(dist_dir):
141141 found = 0
142142 f .write (line )
143143
144- # change board/kconfig path
144+ # change board/kconfig path
145145 if not os .path .isfile (os .path .join (dist_dir , 'board/Kconfig' )):
146146 return
147147
@@ -214,12 +214,21 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
214214 bsp_copy_files (os .path .join (library_path , Env ['bsp_lib_type' ]), os .path .join (library_dir , Env ['bsp_lib_type' ]))
215215 shutil .copyfile (os .path .join (library_path , 'Kconfig' ), os .path .join (library_dir , 'Kconfig' ))
216216
217+ # copy at32 bsp libiary files
218+ if os .path .basename (os .path .dirname (BSP_ROOT )) == 'at32' :
219+ print ("=> copy at32 bsp library" )
220+ library_path = os .path .join (os .path .dirname (BSP_ROOT ), 'Libraries' )
221+ library_dir = os .path .join (dist_dir , 'Libraries' )
222+ bsp_copy_files (os .path .join (library_path , 'rt_drivers' ), os .path .join (library_dir , 'rt_drivers' ))
223+ bsp_copy_files (os .path .join (library_path , 'AT32_Std_Driver' ), os .path .join (library_dir , 'AT32_Std_Driver' ))
224+ shutil .copyfile (os .path .join (library_path , 'Kconfig' ), os .path .join (library_dir , 'Kconfig' ))
225+
217226 # do bsp special dist handle
218- if 'dist_handle' in Env :
227+ if 'dist_handle' in Env :
219228 print ("=> start dist handle" )
220229 dist_handle = Env ['dist_handle' ]
221230 dist_handle (BSP_ROOT )
222-
231+
223232 # get all source files from program
224233 for item in program :
225234 walk_children (item )
@@ -345,6 +354,15 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
345354 bsp_copy_files (os .path .join (library_path , Env ['bsp_lib_type' ]), os .path .join (library_dir , Env ['bsp_lib_type' ]))
346355 shutil .copyfile (os .path .join (library_path , 'Kconfig' ), os .path .join (library_dir , 'Kconfig' ))
347356
357+ # copy at32 bsp libiary files
358+ if os .path .basename (os .path .dirname (BSP_ROOT )) == 'at32' :
359+ print ("=> copy at32 bsp library" )
360+ library_path = os .path .join (os .path .dirname (BSP_ROOT ), 'Libraries' )
361+ library_dir = os .path .join (dist_dir , 'Libraries' )
362+ bsp_copy_files (os .path .join (library_path , 'rt_drivers' ), os .path .join (library_dir , 'rt_drivers' ))
363+ bsp_copy_files (os .path .join (library_path , 'AT32_Std_Driver' ), os .path .join (library_dir , 'AT32_Std_Driver' ))
364+ shutil .copyfile (os .path .join (library_path , 'Kconfig' ), os .path .join (library_dir , 'Kconfig' ))
365+
348366 # do bsp special dist handle
349367 if 'dist_handle' in Env :
350368 print ("=> start dist handle" )
0 commit comments