Skip to content
Permalink
Browse files

stop FAST NET using watchdog

  • Loading branch information...
jabdoa2 committed May 1, 2019
1 parent 87e7f90 commit 90acd6c60da1c0b4a4922edbeaca247228a54d41
Showing with 17 additions and 5 deletions.
  1. +15 −3 mpf/platforms/fast/fast.py
  2. +2 −2 mpf/tests/test_Fast.py
@@ -167,9 +167,21 @@ def initialize(self):

def stop(self):
"""Stop platform and close connections."""
for connection in self.serial_connections:
connection.writer.write(b'BL:AA55\r') # reset CPU using bootloader
connection.stop()
if self.net_connection:
# set watchdog to expire in 1ms
self.net_connection.writer.write(b'WD:1\r')
self.net_connection.stop()
self.net_connection = None

if self.rgb_connection:
self.rgb_connection.writer.write(b'BL:AA55\r') # reset CPU using bootloader
self.rgb_connection.stop()
self.rgb_connection = None

if self.dmd_connection:
self.dmd_connection.writer.write(b'BL:AA55\r') # reset CPU using bootloader
self.dmd_connection.stop()
self.dmd_connection = None

self.serial_connections = set()

@@ -40,7 +40,7 @@ def write(self, msg):
if cmd == (' ' * 256 * 4):
return msg_len

if cmd[:3] == "WD:":
if cmd[:3] == "WD:" and cmd != "WD:1":
self.queue.append("WD:P")
return msg_len

@@ -141,7 +141,7 @@ def tearDown(self):
"BL:AA55": "!SRE"
}
self.net_cpu.expected_commands = {
"BL:AA55": "!SRE"
"WD:1": "WD:P"
}
super().tearDown()
self.assertFalse(self.net_cpu.expected_commands)

0 comments on commit 90acd6c

Please sign in to comment.
You can’t perform that action at this time.