int main(void) { -----. . .
-----retv = finit ("U:");
-----while(1)
-----{
----------retv = usbh_engine(0);
----------con = usbh_msc_status(0,0);
----------if(con==1)
----------{
---------------. . .
----------}
-----}
}
The program is as above.
If a usb mass storage device is connected before power up, then "con=1" after the program
is executed. At this time, "usbh_msc_status" can check the connected mass storage device.
But if no usb mass storage device is connected before power up, then con=0 forever,
whatever a usb mass storage device is connected or not.
How to find the usb device immediately, as soon as the usb mass storage device is connected.
Thanks a lot!
The problem has been solved. The program has no faults. Just to wait a moment, usb mass storage device can be find. It can't be find as soon as it is connected, a short while is needed.