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):
periods = [task.period for task in tasks] try:
hyperperiod = periods[0] periods = [task.period for task in tasks]
for period in periods[1:]: hyperperiod = periods[0]
hyperperiod = lcm(hyperperiod, period) for period in periods[1:]:
return hyperperiod hyperperiod = lcm(hyperperiod, period)
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