Skip to content

Commit 08a4de5

Browse files
authored
Merge pull request #4554 from hyhkjiy/feature/nrf5x
[UPD]nRF5x 'scons --dist' support
2 parents 50700c8 + f109444 commit 08a4de5

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

bsp/nrf5x/nrf52832/rtconfig.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,11 @@
8484
CFLAGS += ' -O2'
8585

8686
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
87+
88+
89+
def dist_handle(BSP_ROOT, dist_dir):
90+
import sys
91+
cwd_path = os.getcwd()
92+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
93+
from sdk_dist import dist_do_building
94+
dist_do_building(BSP_ROOT, dist_dir)

bsp/nrf5x/nrf52840/rtconfig.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,11 @@
8282
CFLAGS += ' -O2'
8383

8484
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
85+
86+
87+
def dist_handle(BSP_ROOT, dist_dir):
88+
import sys
89+
cwd_path = os.getcwd()
90+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
91+
from sdk_dist import dist_do_building
92+
dist_do_building(BSP_ROOT, dist_dir)

bsp/nrf5x/tools/sdk_dist.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
import sys
3+
import shutil
4+
cwd_path = os.getcwd()
5+
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
6+
7+
# BSP dist function
8+
def dist_do_building(BSP_ROOT, dist_dir):
9+
from mkdist import bsp_copy_files
10+
import rtconfig
11+
12+
library_dir = os.path.join(dist_dir, 'libraries')
13+
14+
print("=> copy nrf52 bsp libraries")
15+
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
16+
17+
bsp_copy_files(library_path, library_dir)

0 commit comments

Comments
 (0)