An adaptive scheduling and voltage/frequency selection algorithm for real-time energy harvesting systems