Commit ac5ad742 authored by Aljaž Srebrnič's avatar Aljaž Srebrnič

So, I misunderstood what is_alive is supposed to do.

parent a28ab619
......@@ -30,6 +30,7 @@ class ColorManager(Thread):
current_color = Color(0, 0, 0)
activeFlag = True
spi = spidev.SpiDev()
running = True
def __init__(self):
super().__init__()
......@@ -59,6 +60,9 @@ class ColorManager(Thread):
if self.current_color.green > 0:
self.current_color.green -= 1
def stop(self):
self.running = False
def start_fade(self):
self.activeFlag = False
......@@ -66,7 +70,7 @@ class ColorManager(Thread):
self.unscaled_blue = 0
def run(self):
while self.is_alive():
while self.running:
if self.activeFlag:
self.get_color()
else:
......@@ -111,6 +115,7 @@ def main():
cm.start_fade()
elif messagedata == b"abort":
cm.lights_off()
cm.stop()
else:
print("Unhandled message")
......
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 to comment