-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize sleep func fix error in thread
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from . import _maix | ||
import time | ||
|
||
def sleep_ms(ms : int): | ||
time.sleep(ms * 0.001) | ||
|
||
def sleep_us(us: int): | ||
time.sleep(us * 0.000001) | ||
|
||
_maix.time.sleep = time.sleep | ||
_maix.time.sleep_ms = sleep_ms | ||
_maix.time.sleep_us = sleep_us |