~npisanti/gpiosc

2b7b2be68fc5167cadf29c139f9078a994710faa — Nicola Pisanti 3 months ago 77527e5 master
cleanup
2 files changed, 6 insertions(+), 6 deletions(-)

M src/gpio.h
M src/main.c
M src/gpio.h => src/gpio.h +5 -5
@@ 10,12 10,12 @@
#include <sys/mman.h>
#include <unistd.h>

typedef struct GPIO {
struct gpio_t {
	int fdgpio;
	unsigned int * address;
} GPIO;
};

void gpio_close( GPIO * gpio )
void gpio_close( struct gpio_t * gpio )
{
	if (gpio->fdgpio>=0) { 
		close( gpio->fdgpio );


@@ 24,7 24,7 @@ void gpio_close( GPIO * gpio )

#ifdef __ARM_ARCH

int gpio_init( GPIO * gpio )
int gpio_init( struct gpio_t * gpio )
{
	gpio->fdgpio = 0;
	gpio->address = NULL;


@@ 66,7 66,7 @@ static inline void gpio_low( unsigned int * gpio_addr, unsigned int gpio_numb)

#else

int gpio_init( GPIO * gpio )
int gpio_init( struct gpio_t * gpio )
{
	gpio->fdgpio = 0;
	gpio->address = NULL;

M src/main.c => src/main.c +1 -1
@@ 17,7 17,7 @@ int args_are_not_valid(int argc, char *argv[]);

// --- globals -------
int running = 1;
GPIO gpio;
struct gpio_t gpio;
unsigned int available[MAXPIN + 1];

int main(int argc, char *argv[])