Detect USB connect/disconnect using USBD ROM Stack?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by lpetersen on Wed Dec 09 12:56:37 MST 2015
I've implemented a USB Device MSC on an LPC1837, using LPCOpen 2.12 and based on the usbd_rom_msc_ram example (modified to use external memory).

I'm able to see the device show up in Windows as a drive, and format it through Windows. Now I need to be able to detect when the user has either 'ejected' the drive from Windows or physically disconnected USB so that I can access the files in memory. I can't seem to find documentation on an interrupt or status bit to poll. How can I detect USB connect/disconnect events using the USBD ROM stack?

Much appreciated!