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

Update mcp23s17.c #7

Open
wants to merge 1 commit into
base: master
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
9 changes: 7 additions & 2 deletions src/mcp23s17.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,14 @@ int mcp23s17_enable_interrupts()
write(fd, str_gpio, len);
close(fd);

// I have somme problem with this fonction
//I think thas the folder gpio25 have'nt too motch time to be creat by the raspberry
snprintf(str_filenm, sizeof(str_filenm), "/sys/class/gpio/gpio%d/direction", GPIO_INTERRUPT_PIN);
if ((fd = open(str_filenm, O_WRONLY)) < 0)
return -1;
if ((fd = open(str_filenm, O_WRONLY)) < 0){
usleep (1);
if ((fd = open(str_filenm, O_WRONLY)) < 0)
return -1;
}

write(fd, "in", 3);
close(fd);
Expand Down