Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bananapro #21

Open
wants to merge 2 commits into
base: bananapro
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions gpio/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,18 @@ void doExport (int argc, char *argv [])
exit (1) ;
}

/**/ if ((strcasecmp (mode, "in") == 0) || (strcasecmp (mode, "input") == 0))

/**/ if ((strcasecmp (mode, "in") == 0) || (strcasecmp (mode, "input") == 0))
fprintf (fd, "in\n") ;
else if ((strcasecmp (mode, "out") == 0) || (strcasecmp (mode, "output") == 0))
else if ((strcasecmp (mode, "out") == 0) || (strcasecmp (mode, "output") == 0))
fprintf (fd, "out\n") ;
else if ((strcasecmp (mode, "high") == 0) || (strcasecmp (mode, "up") == 0))
fprintf (fd, "high\n") ;
else if ((strcasecmp (mode, "low") == 0) || (strcasecmp (mode, "down") == 0))
fprintf (fd, "low\n") ;
else
{
fprintf (stderr, "%s: Invalid mode: %s. Should be in or out\n", argv [1], mode) ;
fprintf (stderr, "%s: Invalid mode: %s. Should be in, out, high or low\n", argv [1], mode) ;
exit (1) ;
}

Expand All @@ -496,7 +501,9 @@ void doExport (int argc, char *argv [])

sprintf (fName, "/sys/class/gpio/gpio%d/edge", pin) ;
changeOwner (argv [0], fName) ;


sprintf (fName, "/sys/class/gpio/gpio%d/active_low", pin) ;
changeOwner (argv [0], fName) ;
}


Expand Down