Revision 67c9b292
| setup.sh | ||
|---|---|---|
| 79 | 79 |
|
| 80 | 80 |
# stm32flash setup |
| 81 | 81 |
F|f) |
| 82 |
# initialize submodule |
|
| 83 |
git submodule update --init $(dirname ${BASH_SOURCE[0]})/Host/stm32flash/
|
|
| 84 |
|
|
| 85 |
USER_DIR=${PWD}
|
|
| 86 |
cd $(dirname ${BASH_SOURCE[0]})/Host/stm32flash
|
|
| 87 |
BUILD_STM32FLASH=true |
|
| 88 |
|
|
| 89 |
# test for existing bonary |
|
| 90 |
if [ -f stm32flash ]; then |
|
| 91 |
printf "WARNING: stm32flash binary already exists.\n" |
|
| 92 |
read -p "Would you like to delete and rebuild it? [Y/n] " -n 1 -i "Y" -e USER_INPUT |
|
| 93 |
if [[ $USER_INPUT =~ ^[Yy]$ ]]; then |
|
| 94 |
BUILD_STM32FLASH=true |
|
| 95 |
make clean |
|
| 96 |
elif [[ ! $USER_INPUT =~ ^[YyNn]$ ]]; then |
|
| 97 |
BUILD_STM32FLASH=false |
|
| 98 |
printf "'%s' is no valid selection. Aborting setup.\n" $USER_INPUT |
|
| 99 |
else |
|
| 100 |
BUILD_STM32FLASH=false |
|
| 101 |
fi |
|
| 102 |
fi |
|
| 82 |
USER_DIR=${PWD}
|
|
| 83 |
cd $(dirname ${BASH_SOURCE[0]})
|
|
| 103 | 84 |
|
| 104 |
# build the tool if required |
|
| 105 |
if [ $BUILD_STM32FLASH = true ]; then |
|
| 106 |
make |
|
| 107 |
fi |
|
| 85 |
# initialize submodule |
|
| 86 |
git submodule update --init ./Host/stm32flash/ |
|
| 108 | 87 |
|
| 109 |
cd $USER_DIR |
|
| 110 |
;; |
|
| 88 |
cd ./Host/stm32flash/ |
|
| 89 |
BUILD_STM32FLASH=true |
|
| 90 |
|
|
| 91 |
# test for existing bonary |
|
| 92 |
if [ -f stm32flash ]; then |
|
| 93 |
printf "WARNING: stm32flash binary already exists.\n" |
|
| 94 |
read -p "Would you like to delete and rebuild it? [Y/n] " -n 1 -i "Y" -e USER_INPUT |
|
| 95 |
if [[ $USER_INPUT =~ ^[Yy]$ ]]; then |
|
| 96 |
BUILD_STM32FLASH=true |
|
| 97 |
make clean |
|
| 98 |
elif [[ ! $USER_INPUT =~ ^[YyNn]$ ]]; then |
|
| 99 |
BUILD_STM32FLASH=false |
|
| 100 |
printf "'%s' is no valid selection. Aborting setup.\n" $USER_INPUT |
|
| 101 |
else |
|
| 102 |
BUILD_STM32FLASH=false |
|
| 103 |
fi |
|
| 104 |
fi |
|
| 105 |
|
|
| 106 |
# build the tool if required |
|
| 107 |
if [ $BUILD_STM32FLASH = true ]; then |
|
| 108 |
make |
|
| 109 |
fi |
|
| 110 |
|
|
| 111 |
cd $USER_DIR |
|
| 112 |
;; |
|
| 111 | 113 |
|
| 112 | 114 |
# SerailBoot setup |
| 113 | 115 |
S|s) |
Also available in: Unified diff