making linter happy
This commit is contained in:
parent
990e77d862
commit
6a10a6fc5b
2 changed files with 5 additions and 2 deletions
|
|
@ -36,6 +36,7 @@ except (ImportError, NotImplementedError):
|
|||
Implementation of monotonic_ms for platforms without time.monotonic_ns
|
||||
"""
|
||||
return int(monotonic() * MS_PER_SECOND)
|
||||
|
||||
except (ImportError, NotImplementedError):
|
||||
from time import time_ns
|
||||
|
||||
|
|
|
|||
|
|
@ -27,15 +27,16 @@ Implementation Notes
|
|||
try:
|
||||
from rainbowio import colorwheel # pylint: disable=unused-import
|
||||
except (ImportError, ModuleNotFoundError):
|
||||
|
||||
def colorwheel(pos):
|
||||
# ref: https://github.com/adafruit/circuitpython/blob/main/shared-module/rainbowio/__init__.c
|
||||
pos = pos - ((pos // 256) * 256)
|
||||
shift1 = 0
|
||||
shift2 = 0
|
||||
if (pos < 85):
|
||||
if pos < 85:
|
||||
shift1 = 8
|
||||
shift2 = 16
|
||||
elif (pos < 170):
|
||||
elif pos < 170:
|
||||
pos -= 85
|
||||
shift1 = 0
|
||||
shift2 = 8
|
||||
|
|
@ -47,6 +48,7 @@ except (ImportError, ModuleNotFoundError):
|
|||
p = p if (p < 256) else 255
|
||||
return (p << shift1) | ((255 - p) << shift2)
|
||||
|
||||
|
||||
RED = (255, 0, 0)
|
||||
"""Red."""
|
||||
YELLOW = (255, 150, 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue