From 2285a585453402069185403f48f5de37586348e2 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Wed, 15 Jun 2022 19:41:06 +0800
Subject: [PATCH] update pinloop script
---
bsp/rootfs/files/pinloop.sh | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/bsp/rootfs/files/pinloop.sh b/bsp/rootfs/files/pinloop.sh
index ab61087..dbfdc5b 100755
--- a/bsp/rootfs/files/pinloop.sh
+++ b/bsp/rootfs/files/pinloop.sh
@@ -1,19 +1,19 @@
-#!/bin/bash
+#!/bin/sh
# 40 Pin Header GPIO loop test script, it based on pinctrl shell script
function loop_test()
{
- if [ $# != 3 ] ; then
+ if [[ $# != 3 ]] ; then
echo "ERROR: Invalid input arguments"
return 1;
- fi
+ fi
level=$3
pinctrl $1 $level
res=`pinctrl -i $2`
printf "$1 out [$level] --> $2 in [$res] : "
- if [ $level == $res ] ; then
+ if [[ $level == $res ]] ; then
printf " [ OK ]\n"
else
printf " [ FAIL ]\n"
@@ -22,10 +22,10 @@
}
-if [ $# != 2 ] ; then
+if [[ $# != 2 ]] ; then
echo ""
echo "Usage : $0 Pin1 Pin2"
- echo "Example: $0 GPIO01_IO10 GPIO01_IO11"
+ echo "Example: $0 GPIO1_IO10 GPIO1_IO11"
echo ""
echo "You can check pinmap by 'pinctrl -v' "
echo ""
--
Gitblit v1.9.1