File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ if [ ! -d /sys/class/net/wlan0 ]; then
1010 exit 0
1111fi
1212WIFI_mode_switch_PIN_info=$( gpiofind PIN_${WIFI_mode_switch_PIN} )
13- while [ " $( gpiomon -F %e -n 1 $WIFI_mode_switch_PIN_info ) " == " 1 " ] ; do
13+ while gpiomon -r -s -n 1 -B pull-down $WIFI_mode_switch_PIN_info ; do
1414 wlan0_connected_connection=$( nmcli device status | grep ' ^wlan0.*connected' | tr -s ' ' | cut -d ' ' -f 4)
1515 case " $wlan0_connected_connection " in
1616 hotspot)
3232otg_mode_switch_PIN_info=$( gpiofind PIN_${otg_mode_switch_PIN} )
3333otg_mode_file=" /sys/kernel/debug/usb/fcc00000.dwc3/mode"
3434otg_mode_LED_PIN_info=$( gpiofind PIN_${otg_mode_LED_PIN} )
35- while [ " $( gpiomon -F %e -n 1 $otg_mode_switch_PIN_info ) " == " 1 " ] ; do
35+ while gpiomon -r -s -n 1 -B pull-down $otg_mode_switch_PIN_info ; do
3636 otg_mode=$( cat $otg_mode_file )
3737 if [ " $otg_mode " == " host" ]; then
3838 echo device > $otg_mode_file
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ function gencmd(){
3434gencmd norecord
3535bash -c " $video_play_cmd " &
3636pid_player=$!
37- while [ " $( gpiomon -F %e -n 1 ${GPIO_REC} ) " == " 1 " ] ; do
37+ while gpiomon -r -s -n 1 -B pull-down ${GPIO_REC} ; do
3838 if [ " $video_record " == " 0" ]; then
3939 if [ " $video_player " == " pixelpilot" ]; then
4040 kill -SIGUSR1 $pid_player
@@ -78,5 +78,5 @@ while [ "$(gpiomon -F %e -n 1 ${GPIO_REC})" == "1" ]; do
7878 fi
7979 video_record=' 0'
8080 fi
81- sleep 1
81+ sleep 3
8282done
You can’t perform that action at this time.
0 commit comments