xtacocorex / CHIP_IO

A CHIP IO library for Python: IO+PWM+SPWM+ADC+Utilities
MIT License
272 stars 60 forks source link

Adding error catching for pins in event_gpio.c that are being used by the system while in debug mode #76

Closed Groguard closed 7 years ago

Groguard commented 7 years ago

Adding error catching for pins in event_gpio.c that are being used by the system while in debug mode

len = snprintf(str_gpio, sizeof(str_gpio), "%d", gpio); BUF2SMALL(str_gpio);
ssize_t s = write(fd, str_gpio, len);  e_no = errno;

if (DEBUG)
    if(e_no)
        printf("Something went wrong: %s\n", strerror(e_no));

close(fd);