DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Long Sleep In Pys60

10.26.2005
| 4823 views |
  • submit to reddit
        e32.ao_sleep has a 2147-sec limit. Here is how to
sleep longer. Based on dashboard's exttimer
import e32

def sleep(delay, callback):
    MAX = 2147
    if delay > MAX:
        e32.ao_sleep(MAX, lambda : sleep(delay-MAX, callback))
    else:
        e32.ao_sleep(delay, callback)