USB TC-08 Help
17
© 2005 Pico Technology Limited. All rights reserved.
USBTC08044-2
// Start using the open units
3.3.2.2
usb_tc08_open_unit_async
short usb_tc08_open_unit_async (void)
This routine begins enumerating USB TC-08 units in the background and provides a
return immediately, so the calling thread can continue executing other code.
Note: The driver is thread safe and will not allow access to a single unit from more than
one application. If, therefore,
does not find a unit, check
that other applications are not using the same USB TC-08. This includes applications on
other user accounts on the same computer, where fast user switching is supported.
- The call was successful.
- No more units were found.
- An error occurred, call
The following code is a fragment of a C application which demonstrates how to open a
single unit with the asynchronous open unit functions:
//======================================================
// Opening a unit asynchronously
//======================================================
// Tell the driver to start enumerating the unit in the background
// (usb_tc08_open_unit_async returns immediately)
// handle any error conditions
"Unit failed to open\nThe error code is %d"
// could terminate the application here
"No USB TC08 units found"
// could terminate the application here
// No errors, so start polling usb_tc08_open_unit_progress
// continuously for its enumeration state
usb_tc08_open_unit_progress