added delay to gpio task if signal not present, eliminates cpu time limit error