File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -42,25 +42,35 @@ def begin(self) -> int:
42
42
if not CHECK_STM32 .value ():
43
43
print ("\n Turn on your Arduino Alvik!\n " )
44
44
return - 1
45
- self ._run ()
45
+ self ._begin_update_thread ()
46
46
sleep_ms (100 )
47
47
self ._reset_hw ()
48
+ return 0
48
49
49
- def _run (self ):
50
+ def _begin_update_thread (self ):
50
51
"""
51
52
Runs robot background operations (e.g. threaded update)
52
53
:return:
53
54
"""
54
55
self ._update_thread_running = True
55
56
self ._update_thread_id = _thread .start_new_thread (self ._update , (1 ,))
56
57
57
- def stop (self ):
58
+ def _stop_update_thread (self ):
58
59
"""
59
60
Stops the background operations
60
61
:return:
61
62
"""
62
63
self ._update_thread_running = False
63
64
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
+
64
74
@staticmethod
65
75
def _reset_hw ():
66
76
"""
You can’t perform that action at this time.
0 commit comments