Update various internal key handling stuff to be CircuitPython-compatible

This commit is contained in:
Josh Klar
2018-10-07 00:44:04 -07:00
parent d379acfc97
commit a23acc6131
4 changed files with 27 additions and 23 deletions

View File

@@ -29,16 +29,3 @@ def reset_bootloader():
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
microcontroller.reset()
def sleep_ms(ms):
'''
Tries to sleep for a number of milliseconds in a cross-implementation
way. Will raise an ImportError if time is not available on the platform.
'''
try:
import time
time.sleep_ms(ms)
except AttributeError:
import time
time.sleep(ms / 1000)