Example #1
0
void usb_isr_rst(void) 
{
   UEIR = 0;
   UIR = 0;
   UEIE = 0x9F;
   UIE = STANDARD_INTS & ~__USB_UIF_ACTIVE;

   UADDR = 0;

   usb_disable_endpoints();
   
   usb_token_reset();

   UEP(0) = ENDPT_CONTROL | 0x10;

   while (UIR_TRN) 
   {
      usb_clear_trn();
   }

   UCON_PKTDIS = 0; //SIE token and packet processing enabled

   usb_init_ep0_setup();

   usb_state = USB_STATE_DEFAULT; //put usb mcu into default state
}
Example #2
0
void usb_isr_stall(void) 
{
   if (bit_test(UEP(0),0)) 
   {
      usb_init_ep0_setup();
      bit_clear(UEP(0), 0);
   }

   UIR &= ~(1 << BIT_STALL);
}
Example #3
0
void usb_isr_stall(void) 
{
   debug_usb(debug_putc, "S");
   
   
   if (bit_test(UEP(0),0)) 
   {
      usb_init_ep0_setup();
      bit_clear(UEP(0), 0);
   }
   
   //UIR_STALL = 0;
   UIR &= ~(1 << BIT_STALL);
}