Skip to content

Commit

Permalink
increase size of ctrl_dir and ocp_dir for future use
Browse files Browse the repository at this point in the history
Pad the size of ctrl_dir and ocp_dir to be on the safe side
  • Loading branch information
pdp7 committed Apr 19, 2017
1 parent 01f73c5 commit ff57ef2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ SOFTWARE.
int gpio_mode;
int gpio_direction[120];

char ctrl_dir[43];
char ocp_dir[33];
char ctrl_dir[CTRL_DIR_MAX];
char ocp_dir[OCP_DIR_MAX];

int setup_error = 0;
int module_setup = 0;
Expand Down
7 changes: 5 additions & 2 deletions source/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ using adafruit::bbio::BBIO_err;
#define BOARD 10
#define BCM 11

#define CTRL_DIR_MAX 50
#define OCP_DIR_MAX 50

#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))

#define FILENAME_BUFFER_SIZE 128
Expand All @@ -64,8 +67,8 @@ typedef struct pwm_t {
extern int gpio_mode;
extern int gpio_direction[120];

extern char ctrl_dir[43];
extern char ocp_dir[33];
extern char ctrl_dir[CTRL_DIR_MAX];
extern char ocp_dir[OCP_DIR_MAX];

BBIO_err get_gpio_number(const char *key, unsigned int *gpio);
BBIO_err get_pwm_key(const char *input, char *key);
Expand Down

0 comments on commit ff57ef2

Please sign in to comment.