Added logic to gpio pin implementation