Skip to content

Commit ba742ed

Browse files
committed
Add shell script to automatically build stmhal/ for all pyboards.
1 parent e276753 commit ba742ed

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

stmhal/boards/PYBV3/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define MICROPY_HW_ENABLE_RTC (1)
1313
#define MICROPY_HW_ENABLE_TIMER (1)
1414
#define MICROPY_HW_ENABLE_SERVO (1)
15-
#define MICROPY_HW_ENABLE_DAC (0)
15+
#define MICROPY_HW_ENABLE_DAC (1)
1616
#define MICROPY_HW_ENABLE_I2C1 (1)
1717
#define MICROPY_HW_ENABLE_SPI1 (1)
1818
#define MICROPY_HW_ENABLE_SPI3 (0)

tools/build-stm-latest.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# check/get parameters
4+
if [ $# != 1 ]; then
5+
echo "usage: $0 <dest-dir>"
6+
exit 1
7+
fi
8+
9+
dest_dir=$1
10+
11+
# check we are in the correct directory
12+
if [ ! -r modpyb.c ]; then
13+
echo "must be in stm directory"
14+
exit 1
15+
fi
16+
17+
# get the date
18+
date=$(date '+%Y-%m-%d')
19+
20+
# get the git hash
21+
git_hash="$(git rev-parse --short HEAD 2> /dev/null || echo unknown)"
22+
23+
# build the versions
24+
for board in PYBV3 PYBV10; do
25+
echo $board
26+
lower_board=$(echo $board | tr A-Z a-z)
27+
build_dir=/tmp/stm-build-$lower_board
28+
make -B BOARD=$board BUILD=$build_dir || exit 1
29+
mv $build_dir/flash.dfu $dest_dir/$lower_board-$date-$git_hash.dfu
30+
rm -rf $build_dir
31+
done

0 commit comments

Comments
 (0)