Replace defines with constants, changed gpio defines to array.