Commit 0eebc506 by Tobias Langer

Fixed error.

parent a726d4c4
...@@ -55,11 +55,14 @@ def lcm(a, b): ...@@ -55,11 +55,14 @@ def lcm(a, b):
return (a * b) / gcd(a, b) return (a * b) / gcd(a, b)
def hyperperiod(tasks): def hyperperiod(tasks):
try:
periods = [task.period for task in tasks] periods = [task.period for task in tasks]
hyperperiod = periods[0] hyperperiod = periods[0]
for period in periods[1:]: for period in periods[1:]:
hyperperiod = lcm(hyperperiod, period) hyperperiod = lcm(hyperperiod, period)
return hyperperiod return hyperperiod
except IndexError:
return 0
class Timebase(Enum): class Timebase(Enum):
seconds = 1 seconds = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment