Detecting when a USB device has been disconnected using usbd_core.c

So, working in the embedded system, I have a USB drive that is used to charge the device, as well as to read some data.

Using usbd_core.c, I can check the status,

  • when nothing is related to state 4( USBD_STATE_SUSPENDED).
  • As soon as I connect something, the status changes to 1( USBD_STATE_DEFAULT).
  • But when I turn it off, the status does not change, it remains 1( USBD_STATE_DEFAULT).

Is this supposed to be the case or am I missing something?

I also tried USBD_Stop()and USBD_Start()to find out if it does not matter, but at the same time I will not turn off its status.

Any ideas?

+4
source share
1 answer

USB USB:

  • : USB, USB.

  • : USB , reset.

  • : USB. reset, .

  • : USB, reset , .

  • : . .

  • : , - 3 .

, , , , -, .

- USB- - API .

+1

All Articles