From 2b1daffb81b7c017020f5f82f6e2addffc9fb69b Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Sat, 3 Jul 2021 07:20:02 +0100 Subject: [PATCH] Fix CPLD detection sometimes failing CPLD detection would sometimes fail if emulator was running, so fail with a message to stop the emulator _before_ detection. The emulator check will remain in nprog too for those who run that directly. --- flash.sh | 5 +++++ flash_experimental.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/flash.sh b/flash.sh index 3bd48b5..b55447e 100755 --- a/flash.sh +++ b/flash.sh @@ -1,5 +1,10 @@ #!/bin/bash set -o pipefail +if pgrep -x "emulator" > /dev/null +then + echo "PiStorm emulator is running, please stop it first" + exit 1 +fi if ! command -v openocd &> /dev/null then echo "openocd is not installed, please run \"sudo apt install openocd\"" diff --git a/flash_experimental.sh b/flash_experimental.sh index 4ae4b5e..76cff64 100755 --- a/flash_experimental.sh +++ b/flash_experimental.sh @@ -1,5 +1,10 @@ #!/bin/bash set -o pipefail +if pgrep -x "emulator" > /dev/null +then + echo "PiStorm emulator is running, please stop it first" + exit 1 +fi if ! command -v openocd &> /dev/null then echo "openocd is not installed, please run \"sudo apt install openocd\""