mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
Close ANT channels before stopping session
This appears to resolve an intermittent issue with the USB2 stick not responding to reset messages when re-opened.
This commit is contained in:
16
src/ANT.cpp
16
src/ANT.cpp
@@ -310,6 +310,22 @@ ANT::pause()
|
||||
int
|
||||
ANT::stop()
|
||||
{
|
||||
// Close the connections to ANT devices before we stop. Sending the
|
||||
// "close channel" ANT message seems to resolve an intermittent
|
||||
// issue of unresponsive USB2 stick on subsequent opens.
|
||||
|
||||
if (antIDs.count()) {
|
||||
foreach(QString antid, antIDs) {
|
||||
if (antid.length()) {
|
||||
unsigned char c = antid.at(antid.length()-1).toLatin1();
|
||||
int ch_type = interpretSuffix(c);
|
||||
int device_number = antid.mid(0, antid.length()-1).toInt();
|
||||
|
||||
removeDevice(device_number, ch_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// what state are we in anyway?
|
||||
pvars.lock();
|
||||
Status = 0; // Terminate it!
|
||||
|
||||
Reference in New Issue
Block a user