Contki's scheduler functions