Re: Listen for "USB_DETECTED" events?


Benjamin Lindqvist
 

Hey Pawel,

I noticed `int usb_dc_ep_set_callback(const u8_t ep, const usb_dc_ep_callback cb);` in `usb_dc.h`, but using them doesn't sound so stable to me. Since `usb_dc_ep_set_callback` actually *overwrites* the currently registered callback (that's what it looks like anyway), we'd break everything inside the usb stack that relies on that cb.

Using the nordic HAL directly is an ok workaround for me (just check NRF_POWER->USBREGSTATUS for instance) but it seems like a reasonable thing to present in a public API too.

On Fri, Sep 13, 2019 at 8:32 AM <pawel.dunaj@...> wrote:
Have you checked USB_DC_CONNECTED event? You can get it through a callback given while registering a class device.

Join devel@lists.zephyrproject.org to automatically receive all group messages.