Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/software/USB/device_handles/usb_device_handle_mac.cpp
- +++ b/software/USB/device_handles/usb_device_handle_mac.cpp
- @@ -20,6 +20,7 @@ limitations under the License.
- #include "usb_device_handle.hpp"
- #include "macros.h"
- +#include "antmessage.h"
- #include "usb_device_handle_vcp.hpp"
- #include "usb_device_handle_si_iokit.hpp"
- @@ -236,6 +237,19 @@ BOOL USBDeviceHandle::Open(const USBDevice& clDevice_, USBDeviceHandle*& pclDevi
- }
- }
- + if(bSuccess && clDevice_.GetDeviceType() != DeviceType::SI_LABS_IOKIT && clDevice_.GetDeviceType() != DeviceType::SI_LABS)
- + {
- + // Workaround for USB2/m data toggle syncronization and busy bit issue
- + UCHAR aucReqCapabilitiesMsg[MESG_FRAME_SIZE + 2] = {0xA4, 0x02, 0x4D, 0x00, 0x54, 0xBF};
- + UCHAR aucCapabilitiesMsg[MESG_MAX_SIZE];
- + ULONG ulBytesWritten, ulBytesRead = 0;
- +
- + pclDeviceHandle_->Write(aucReqCapabilitiesMsg, sizeof(aucReqCapabilitiesMsg), ulBytesWritten);
- + pclDeviceHandle_->Write(aucReqCapabilitiesMsg, sizeof(aucReqCapabilitiesMsg), ulBytesWritten);
- + pclDeviceHandle_->Read(aucCapabilitiesMsg, sizeof(aucCapabilitiesMsg), ulBytesRead, 10);
- + pclDeviceHandle_->Read(aucCapabilitiesMsg, sizeof(aucCapabilitiesMsg), ulBytesRead, 10);
- + }
- +
- return bSuccess;
- }
- --- a/software/USB/device_handles/usb_device_handle_win.cpp
- +++ b/software/USB/device_handles/usb_device_handle_win.cpp
- @@ -16,6 +16,7 @@ limitations under the License.
- #include "types.h"
- #if defined(DSI_TYPES_WINDOWS)
- +#include "antmessage.h"
- #include "usb_device_handle.hpp"
- @@ -156,6 +157,19 @@ BOOL USBDeviceHandle::Open(const USBDevice& clDevice_, USBDeviceHandle*& pclDevi
- }
- }
- + if(bSuccess && clDevice_.GetDeviceType() != DeviceType::SI_LABS_IOKIT && clDevice_.GetDeviceType() != DeviceType::SI_LABS)
- + {
- + // Workaround for USB2/m data toggle syncronization and busy bit issue
- + UCHAR aucReqCapabilitiesMsg[MESG_FRAME_SIZE + 2] = {0xA4, 0x02, 0x4D, 0x00, 0x54, 0xBF};
- + UCHAR aucCapabilitiesMsg[MESG_MAX_SIZE];
- + ULONG ulBytesWritten, ulBytesRead = 0;
- +
- + pclDeviceHandle_->Write(aucReqCapabilitiesMsg, sizeof(aucReqCapabilitiesMsg), ulBytesWritten);
- + pclDeviceHandle_->Write(aucReqCapabilitiesMsg, sizeof(aucReqCapabilitiesMsg), ulBytesWritten);
- + pclDeviceHandle_->Read(aucCapabilitiesMsg, sizeof(aucCapabilitiesMsg), ulBytesRead, 10);
- + pclDeviceHandle_->Read(aucCapabilitiesMsg, sizeof(aucCapabilitiesMsg), ulBytesRead, 10);
- + }
- +
- return bSuccess;
- }
- --- a/software/serial/device_management/dsi_ant_device.cpp
- +++ b/software/serial/device_management/dsi_ant_device.cpp
- @@ -298,17 +298,11 @@ BOOL DSIANTDevice::ConnectToDevice(void)
- ulUSBSerialNumber = pclSerialObject->GetDeviceSerialNumber();
- //Reset so we know we have a clean state
- - int i = 0;
- - while(i++ < 10)
- - {
- - pclANT->ResetSystem(1000);
- -
- - failedConnect = !pclANT->GetCapabilities(NULL, 200); //This function always returns. If this fails something is wrong at the serial layer, often caused using the wrong baud rate
- -
- - if(!failedConnect)
- - break;
- - }
- + pclANT->ResetSystem(200);
- + //If this fails it is probably connected at the wrong baud rate
- + if(pclANT->GetCapabilities(NULL, 200) == FALSE)
- + failedConnect = TRUE;
- //TODO could get number of channels and use dynamic sized channel array
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement