凌云实验室推出的ARM Linux物联网网关开发板IGKBoard(IoT Gateway Kit Board)项目源码
guowenxue
2022-04-16 f51706ff011fb2e663721afe9b8389a83940ae08
update pinctrl shell script
2 files modified
20 ■■■■ changed files
bsp/rootfs/files/pinctrl 12 ●●●● patch | view | raw | blame | history
bsp/rootfs/files/pinloop.sh 8 ●●●● patch | view | raw | blame | history
bsp/rootfs/files/pinctrl
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# This shell script used to control GPIO port on IGKBoard
direction=out
@@ -100,7 +100,7 @@
    cat $pindir/value
}
if [ $# -lt 1 ] ; then
if [[ $# -lt 1 ]] ; then
   usage;
fi
@@ -108,12 +108,12 @@
do
    case "${OPTNAME}" in
        "i")
           direction=in
           direction="in"
           shift
           ;;
        "u")
           action=unexport;
           action="unexport";
           shift
           ;;
@@ -130,14 +130,14 @@
calc_pinum $1
if [[ $action == unexport ]] ; then
if [[ "$action" == "unexport" ]] ; then
   unexport_gpio
   exit;
fi
export_gpio
if [ $direction == in ] ; then
if [[ "$direction" == "in" ]] ; then
   read_gpio
else
   set_gpio $2
bsp/rootfs/files/pinloop.sh
@@ -1,9 +1,9 @@
#!/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 
@@ -13,7 +13,7 @@
   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,7 +22,7 @@
}
if [ $# != 2 ] ; then
if [[ $# != 2 ]] ; then
   echo ""
   echo "Usage  : $0 Pin1 Pin2"
   echo "Example: $0 GPIO01_IO10 GPIO01_IO11"