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

Fix build error #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int gpio_open(unsigned int gpio_id, const char *direction)
{
int rc = -1;
gpio_list *ptr;
gpio *g = libsoc_gpio_request(gpio_id, LS_SHARED);
gpio *g = libsoc_gpio_request(gpio_id, LS_GPIO_SHARED);
if (!g)
return rc;
if (!strcmp(direction, "in"))
Expand Down
9 changes: 9 additions & 0 deletions lib/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
#define HIGH 1
#define LOW 0


#ifdef __cplusplus
extern "C" {
#endif

// Look up gpio ID by pin name, eg "GPIO_A"
unsigned int gpio_id(const char *pin_name);
// Look up gpio ID by letter, eq 'A'
Expand All @@ -38,3 +43,7 @@ int gpio_open(unsigned int gpio_id, const char *direction);
int digitalRead(unsigned int gpio_id);
// Set a GPIO in OUTPUT mode to HIGH(1) or LOW(0)
int digitalWrite(unsigned int gpio_id, unsigned int value);

#ifdef __cplusplus
}
#endif