Update gpio.c

Added check to error.
Resized variables
Clean.