File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ export BOARDS=" edge edge2 artemis artemis_thing_plus redboard_artemis redboard_artemis_atp redboard_artemis_nano artmbed"
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments