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.
Look into MDK examples MSD_File they should explain how it should work.
What was wrong with using the more conventional method of posting source code (using the tags explicitly mentioned directly above the message input box) and without any need for "-" to represent indentation?
int main(void) { ... retv = finit ("U:"); ... while (1) { retv = usbh_engine(0); con = usbh_msc_status(0,0); if (con==1) { ... } } }