Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ondrej1024/crelay
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondrej Wisniewski committed Dec 13, 2021
2 parents 9fe9d0c + 5aed2ef commit a73ff53
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ typedef struct
/* [GPIO drv] */
uint8_t gpio_num_relays;
uint8_t gpio_active_value;
uint8_t relay1_gpio_pin;
uint8_t relay2_gpio_pin;
uint8_t relay3_gpio_pin;
uint8_t relay4_gpio_pin;
uint8_t relay5_gpio_pin;
uint8_t relay6_gpio_pin;
uint8_t relay7_gpio_pin;
uint8_t relay8_gpio_pin;
uint16_t relay1_gpio_pin;
uint16_t relay2_gpio_pin;
uint16_t relay3_gpio_pin;
uint16_t relay4_gpio_pin;
uint16_t relay5_gpio_pin;
uint16_t relay6_gpio_pin;
uint16_t relay7_gpio_pin;
uint16_t relay8_gpio_pin;

/* [Sainsmart drv] */
uint8_t sainsmart_num_relays;
Expand Down
10 changes: 5 additions & 5 deletions src/relay_drv_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#define GPIO_BASE_FILE GPIO_BASE_DIR"gpio"


static uint8_t pins[] =
static uint16_t pins[] =
{
0, // dummy
0, // pin 1
Expand Down Expand Up @@ -85,7 +85,7 @@ int set_relay_generic_gpio(char* portname, uint8_t relay, relay_state_t relay_st
* -1 - fail
* -2 - already exported
*********************************************************/
static int do_export(uint8_t pin)
static int do_export(uint16_t pin)
{
int fd;
char b[64];
Expand Down Expand Up @@ -151,7 +151,7 @@ static int do_export(uint8_t pin)
* Return: 0 - success
* -1 - fail
*********************************************************/
static int do_unexport(uint8_t pin)
static int do_unexport(uint16_t pin)
{
int fd;
char b[64];
Expand Down Expand Up @@ -261,7 +261,7 @@ int get_relay_generic_gpio(char* portname, uint8_t relay, relay_state_t* relay_s
int fd;
char b[64];
char d[1];
uint8_t pin;
uint16_t pin;

if (relay<FIRST_RELAY || relay>(FIRST_RELAY+g_num_relays-1))
{
Expand Down Expand Up @@ -324,7 +324,7 @@ int set_relay_generic_gpio(char* portname, uint8_t relay, relay_state_t relay_st
int fd;
char b[64];
char d[1];
uint8_t pin;
uint16_t pin;

if (relay<FIRST_RELAY || relay>(FIRST_RELAY+g_num_relays-1))
{
Expand Down

0 comments on commit a73ff53

Please sign in to comment.