Fix #757 - Some effects are running extreme slowly. (#763)

This commit is contained in:
LordGrey 2020-04-13 12:00:10 +02:00 committed by GitHub
parent 060d9f45ec
commit 77ee96ab4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ colorEndTime = float(hyperion.args.get('color-end-time', 1000)) / 1000
repeat = hyperion.args.get('repeat-count', 0)
maintainEndCol = hyperion.args.get('maintain-end-color', True)
minStepTime = float(hyperion.latchTime)/1000.0
if minStepTime == 0: minStepTime = 1
if minStepTime == 0: minStepTime = 0.001
currentR = currentG = currentB = 0
# create color table for fading from start to end color

View File

@ -7,7 +7,7 @@ ledData = bytearray()
ledDataBuf = bytearray()
color_step = []
minStepTime= float(hyperion.latchTime)/1000.0
if minStepTime == 0: minStepTime = 1
if minStepTime == 0: minStepTime = 0.001
fadeSteps = min(256.0, math.floor(sleepTime/minStepTime))
if fadeSteps == 0: fadeSteps = 1

View File

@ -25,7 +25,7 @@ def getSTime(rt, steps = 360):
# adapt sleeptime to hardware
minStepTime= float(hyperion.latchTime)/1000.0
if minStepTime == 0: minStepTime = 1
if minStepTime == 0: minStepTime = 0.001
if minStepTime > sleepTime:
sleepTime = minStepTime
return sleepTime

View File

@ -7,7 +7,7 @@ for i in range(hyperion.ledCount):
sleepTime = float(hyperion.args.get('speed', 1.0)) * 0.004
minStepTime = float(hyperion.latchTime)/1000.0
if minStepTime == 0: minStepTime = 1
if minStepTime == 0: minStepTime = 0.001
factor = 1 if sleepTime > minStepTime else int(math.ceil(minStepTime/sleepTime))
runners = [