Hi,
I use a MCF52210 for a USB application. My program works fine except when I remove the USB key, it is not detected.
For that, I use the following code to detect the removal (detect a reset):
if(MCF_USB_INT_STAT & MCF_USB_INT_STAT_USB_RST)
{
...
// Remove the reset condition
MCF_USB_INT_STAT = MCF_USB_INT_STAT_USB_RST | MCF_USB_INT_STAT_ATTACH;
...
}
I enable USB interrupts at initialisation like that:
MCF_USB_INT_ENB = MCF_USB_INT_ENB_SLEEP | MCF_USB_INT_ENB_TOK_DNE
| MCF_USB_INT_ENB_ERROR | MCF_USB_INT_ENB_USB_RST
| MCF_USB_INT_ENB_STALL;
Is there something wrong with that code ?
Frelon