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

Use externs in common.h #26

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
3 changes: 3 additions & 0 deletions ext/rpi_gpio/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const int pin_to_gpio_rev2[41] = {-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 1
const int pin_to_gpio_rev3[41] = {-1, -1, -1, 2, -1, 3, -1, 4, 14, -1, 15, 17, 18, 27, -1, 22, 23, -1, 24, 10, -1, 9, 25, 11, 8, -1, 7, -1, -1, 5, -1, 6, 12, 13, -1, 19, 16, 26, 20, -1, 21 };
int setup_error = 0;
int module_setup = 0;
const int (*pin_to_gpio)[41];
int gpio_direction[54];
rpi_info rpiinfo;

int check_gpio_priv(void)
{
Expand Down
18 changes: 9 additions & 9 deletions ext/rpi_gpio/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ SOFTWARE.
#define I2C 42
#define PWM 43

int gpio_mode;
const int pin_to_gpio_rev1[41];
const int pin_to_gpio_rev2[41];
const int pin_to_gpio_rev3[41];
const int (*pin_to_gpio)[41];
int gpio_direction[54];
rpi_info rpiinfo;
int setup_error;
int module_setup;
extern int gpio_mode;
extern const int pin_to_gpio_rev1[41];
extern const int pin_to_gpio_rev2[41];
extern const int pin_to_gpio_rev3[41];
extern const int (*pin_to_gpio)[41];
extern int gpio_direction[54];
extern rpi_info rpiinfo;
extern int setup_error;
extern int module_setup;
int check_gpio_priv(void);
int get_gpio_number(int channel, unsigned int *gpio);