Totally untested thought...
what happen if you stop calling USBSERVICE?
thereafter, what may happen if you use the method shown in the famous known "POST 148"
Code:
' snip
usb_device_state var byte EXT
CONFIGURED_STATE CON EXT
DoUSBinit:
pause 500
usbinit ' initialise USB...
repeat ' kick-start it
usbservice
until usb_device_state = CONFIGURED_STATE
POST 148
http://www.picbasic.co.uk/forum/show...&postcount=148
EDIT 1:
Here's the complete list for usb_device_state var
Code:
; USB Device States - To be used with [byte usb_device_state]
#define DETACHED_STATE 0
#define ATTACHED_STATE 1
#define POWERED_STATE 2
#define DEFAULT_STATE 3
#define ADR_PENDING_STATE 4
#define ADDRESS_STATE 5
#define CONFIGURED_STATE 6
EDIT:2
I don't think you can relly on that ding-dong noise... check USBDemo, it has this fake led showing if the device is connected or not. An another alternative is to use USBDeview...
http://www.nirsoft.net/utils/usb_devices_view.html
Last edited by mister_e; - 10th November 2008 at 19:26.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks