This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

function "usbh_msc_status()" can't check the connected usb hardware .

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.

Parents
  • 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) {
                ...
            }
        }
    }
    

Reply
  • 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) {
                ...
            }
        }
    }
    

Children
No data