Skip to content

Commit e29e429

Browse files
committed
mod: upd_thread methods naming
1 parent f6b3046 commit e29e429

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

arduino_alvik.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,35 @@ def begin(self) -> int:
4242
if not CHECK_STM32.value():
4343
print("\nTurn on your Arduino Alvik!\n")
4444
return -1
45-
self._run()
45+
self._begin_update_thread()
4646
sleep_ms(100)
4747
self._reset_hw()
48+
return 0
4849

49-
def _run(self):
50+
def _begin_update_thread(self):
5051
"""
5152
Runs robot background operations (e.g. threaded update)
5253
:return:
5354
"""
5455
self._update_thread_running = True
5556
self._update_thread_id = _thread.start_new_thread(self._update, (1,))
5657

57-
def stop(self):
58+
def _stop_update_thread(self):
5859
"""
5960
Stops the background operations
6061
:return:
6162
"""
6263
self._update_thread_running = False
6364

65+
def stop(self):
66+
"""
67+
Stops all Alvik operations
68+
:return:
69+
"""
70+
# stop engines
71+
# turn off UI leds
72+
self._stop_update_thread()
73+
6474
@staticmethod
6575
def _reset_hw():
6676
"""

0 commit comments

Comments
 (0)