Skip to content

Commit ebf0f5e

Browse files
committed
add bsp copy scripts
1 parent 58b3c53 commit ebf0f5e

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

tools/variants/arduino_boards.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export BOARDS="edge edge2 artemis artemis_thing_plus redboard_artemis redboard_artemis_atp redboard_artemis_nano artmbed"

tools/variants/regen_variants.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env bash
2+
3+
# use this script to update variants based on bsp files
4+
5+
6+
7+
# setup
8+
set -e
9+
set -o errexit
10+
echo "" 1>&2
11+
12+
# get enclosing directory
13+
DIR=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
14+
15+
# defaults
16+
BSP_ROOT=.
17+
BOARDS_FILE=$DIR/arduino_boards.sh
18+
VARIANTS_ROOT=../../variants
19+
20+
# handle arguments
21+
while getopts ":r:b:" opt; do
22+
case $opt in
23+
r) BSP_ROOT="$OPTARG"
24+
;;
25+
b) BOARDS_FILE="$OPTARG"
26+
;;
27+
\?) echo "Invalid option -$OPTARG" 1>&2
28+
;;
29+
esac
30+
done
31+
32+
# verify bsp root
33+
echo "Using \$BSP_ROOT=$BSP_ROOT" 1>&2
34+
VFILE=$BSP_ROOT/README.md
35+
if [ -f "$VFILE" ];
36+
then
37+
echo "\$BSP_ROOT verification passed" 1>&2
38+
else
39+
echo "\$BSP_ROOT verification failed" 1>&2
40+
exit 1
41+
fi
42+
43+
# load in boards to handle
44+
echo "Using \$BOARDS_FILE=$BOARDS_FILE" 1>&2
45+
source $BOARDS_FILE
46+
47+
# copy bsp files from BSP repo to Arduino variants
48+
echo "" 1>&2
49+
for value in $BOARDS
50+
do
51+
echo "Copying bsp files for: $value" 1>&2
52+
cp $BSP_ROOT/$value/bsp/am_bsp_pins.c $VARIANTS_ROOT/$value/bsp/am_bsp_pins.c
53+
cp $BSP_ROOT/$value/bsp/am_bsp_pins.h $VARIANTS_ROOT/$value/bsp/am_bsp_pins.h
54+
cp $BSP_ROOT/$value/bsp/am_bsp.c $VARIANTS_ROOT/$value/bsp/am_bsp.c
55+
cp $BSP_ROOT/$value/bsp/am_bsp.h $VARIANTS_ROOT/$value/bsp/am_bsp.h
56+
done

0 commit comments

Comments
 (0)