[riot-notifications] [RIOT-OS/RIOT] tools/openocd: check if variable for extra reset_config is set (#12157)

Gaëtan Harter notifications at github.com
Tue Sep 3 11:26:11 CEST 2019


Good catch.

We do not need to check for it being an integer, matching to a string also works and would remove the warning on an empty value:

``` diff
diff --git a/dist/tools/openocd/openocd.sh b/dist/tools/openocd/openocd.sh
index 3a73038e0..e6776bbee 100755
--- a/dist/tools/openocd/openocd.sh
+++ b/dist/tools/openocd/openocd.sh
@@ -121,8 +121,7 @@
 # The single quotes are important on the line above, or it will not work.

 # Handle OPENOCD_RESET_USE_CONNECT_ASSERT_SRST
-if ([ ! -z "${OPENOCD_RESET_USE_CONNECT_ASSERT_SRST}" ] && \
-    [ "${OPENOCD_RESET_USE_CONNECT_ASSERT_SRST}" -eq 1 ]); then
+if [ "${OPENOCD_RESET_USE_CONNECT_ASSERT_SRST}" = "1" ]; then
   OPENOCD_EXTRA_RESET_INIT+="-c 'reset_config connect_assert_srst'"
 fi

```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12157#issuecomment-527379872
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190903/fd29c416/attachment.htm>


More information about the notifications mailing list