carl9170 firmware: refactor timer functions