Skip to content

Commit

Permalink
reset driver on start for the fast platform
Browse files Browse the repository at this point in the history
  • Loading branch information
jabdoa2 committed Jan 30, 2016
1 parent 7508f0a commit a67d95d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions mpf/platform/fast.py
Expand Up @@ -845,6 +845,19 @@ def __init__(self, config, sender, machine):
self.driver_settings.update(self.merge_driver_settings(**config))

self.log.debug("Driver Settings: %s", self.driver_settings)
self.reset()

def reset(self):
"""
Resets a driver
"""
self.log.debug("Reseting driver %s", self.driver_settings)
cmd = (self.driver_settings['config_cmd'] +
self.driver_settings['number'] +
',00,00,00')
self.send(cmd)

def create_driver_settings(self, machine, pulse_ms=None, **kwargs):
return_dict = dict()
Expand Down
5 changes: 4 additions & 1 deletion tests/test_Fast.py
Expand Up @@ -47,7 +47,10 @@ def setUp(self):
MockSerialCommunicator.expected_commands = {
"SA:" : "SA:0,00,32,00",
"SN:16,01,a,a" : "SN:",
"SN:07,01,a,a" : "SN:"
"SN:07,01,a,a" : "SN:",
"DN:04,00,00,00" : False,
"DN:06,00,00,00" : False,
"DN:09,00,00,00" : False,
}
# FAST should never call sleep. Make it fail
self.sleep = time.sleep
Expand Down

0 comments on commit a67d95d

Please sign in to comment.