Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix driver for Suumo Movestick Mini #24

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/ant.core/04-processevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def process(self, msg):
print 'Heart Rate:', ord(msg.payload[-1])

# Initialize
stick = driver.USB1Driver(SERIAL, log=LOG, debug=DEBUG)
stick = driver.USB2Driver(SERIAL, log=LOG, debug=DEBUG)
antnode = node.Node(stick)
antnode.start()

Expand Down
3 changes: 2 additions & 1 deletion src/ant/core/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
# USB2 driver uses direct USB connection. Requires PyUSB
import usb.core
import usb.util
import usb.control

from ant.core.exceptions import DriverError

Expand Down Expand Up @@ -194,7 +195,7 @@ def _open(self):
alternate_setting = usb.control.get_interface(dev, interface_number)
intf = usb.util.find_descriptor(
cfg, bInterfaceNumber = interface_number,
AlternateSetting = alternate_setting
bAlternateSetting = alternate_setting
)
usb.util.claim_interface(dev, interface_number)
ep_out = usb.util.find_descriptor(
Expand Down
5 changes: 3 additions & 2 deletions src/ant/core/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

def ProcessBuffer(buffer_):
messages = []

while True:
hf = Message()
try:
Expand All @@ -63,8 +63,9 @@ def EventPump(evm):
evm.pump_lock.release()

go = True
buffer_ = ''

while go:
buffer_ = ''
evm.running_lock.acquire()
if not evm.running:
go = False
Expand Down