#/bin/bash RET=0 KEY_GPIO_WPS=14 sleep 2 echo " " echo " " echo " " echo "######################################################################################" source `pwd`/mt_gpio.sh echo "########################## KEY Testing Start ##########################" if [ ! -f /sys/class/gpio/gpio442/direction ]; then mt_gpio_export ${KEY_GPIO_WPS} #Enable WPS 428 + 14 = 442 fi mt_gpio_dir ${KEY_GPIO_WPS} in echo -n "Please Press one Key about WPS Key of GPIO_WPS GPIO14 about 20s ......" i=0 while true; do mt_gpio_in ${KEY_GPIO_WPS} if [ $? == 0 ]; then echo "### GPIO_WPS GPIO14 Key is in low level, Key is available ###" break else echo "waiting 1 second......" sleep 1 fi let i=i+1 if [ $i -ge 20 ]; then echo " ### 20s Wait time is over, it can not detect the key ###" RET=1 break fi done echo "######################################################################################" echo " " echo " " echo " " sleep 2 return ${RET}