cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

Anonymous
Not applicable

Hello,

   

 

   

can somebody explain why the main thread in the sourcesink example is trying each 2 seconds to get the LPM back to U0?

   

 

   

With that code snippet:

   

        /* Try to get the USB 3.0 link back to U0. */
        {
            CyU3PUsbLinkPowerMode curState;

            if (CyU3PUsbGetSpeed () == CY_U3P_SUPER_SPEED)
            {
                /* If the link is in U1/U2 states, try to get back to U0. */
                stat = CyU3PUsbGetLinkPowerState (&curState);
                while ((stat == CY_U3P_SUCCESS) && (curState >= CyU3PUsbLPM_U1) && (curState <= CyU3PUsbLPM_U3))
                {
                    CyU3PUsbSetLinkPowerState (CyU3PUsbLPM_U0);
                    CyU3PThreadSleep (1);
                    stat = CyU3PUsbGetLinkPowerState (&curState);
                }
            }
        }
 

   

For what use is this?

   

Why polling each two seconds?

   

Why not doing this in the LPM callback function if the LPM state changes to other than U0?

   

 

   

Thanks,

   

lumpi

0 Likes
4 Replies
Anonymous
Not applicable

Hi Lumpi,

   

What is the version of the SDK that you are using. I could not find it in my projects.

   

Regards,

   

sai krishna.

0 Likes
Anonymous
Not applicable

Hi Sai Krishna,

   

 

   

it is FX3 SDK version 1.1.1 release B818. I append you the .c file of the USBBulkSourceSink example.

   

 

   

regards

   

Lumpi

0 Likes
Anonymous
Not applicable

Hi,

   

here the file again as a zip archiv.

   

regards,

   

lumpi

0 Likes
Anonymous
Not applicable

Hi Lumpi,

   

This part of code is not compulsory to have in your projects.

   

It is just that we intended to show a piece of code to come back into U0 mode incase if you get stuck in any low power mode.

   

Thanks,

   

sai krishna.

0 Likes