Skip to content

Commit

Permalink
only toggle gpio for ircut, keep state in tmp file (EliasKotlyar#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
peturdainn authored and EliasKotlyar committed May 8, 2018
1 parent 719cf18 commit 480fc5a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 10 additions & 4 deletions firmware_mod/scripts/common_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,24 @@ ir_cut(){
on)
setgpio 25 0
setgpio 26 1
sleep 1
setgpio 26 0
echo "1" > /var/run/ircut
;;
off)
setgpio 25 1
setgpio 26 0
setgpio 25 1
sleep 1
setgpio 25 0
echo "0" > /var/run/ircut
;;
status)
status=$(getgpio 25)
status=$(cat /var/run/ircut)
case $status in
0)
1)
echo "ON"
;;
1)
0)
echo "OFF"
;;
esac
Expand Down
8 changes: 7 additions & 1 deletion firmware_mod/www/cgi-bin/action.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ if [ -n "$F_cmd" ]; then
ir_cut_on)
setgpio 25 0
setgpio 26 1
sleep 1
setgpio 26 0
echo "1" > /var/run/ircut
;;

ir_cut_off)
setgpio 25 1
setgpio 26 0
setgpio 25 1
sleep 1
setgpio 25 0
echo "0" > /var/run/ircut
;;

motor_left)
Expand Down

0 comments on commit 480fc5a

Please sign in to comment.