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.
View all questions in Keil forum