User manual

mikroC PRO for dsPIC
MikroElektronika
665
USB_Interrupt_Proc
Prototype
void USB_Interrupt_Proc(void);
Description This routine is used for servicing various USB bus events. Should be called inside USB interrupt
routine.
Parameters None.
Returns Nothing.
Requires Nothing.
Example
void USB1Interrupt() iv IVT_ADDR_USB1INTERRUPT {
USB_Interrupt_Proc();
}
Notes Do not use this function with USB_Polling_Proc, only one should be used. To enable servicing through
interrupt, USB_INTERRUPT constant should be set (it is set by default in descriptor le).
USB_Polling_Proc
Prototype
void USB_Polling_Proc(void);
Description This routine is used for servicing various USB bus events. It should be periodically, preferably every
100 microseconds.
Parameters None.
Returns Nothing.
Requires Nothing.
Example
while(1) {
USB_Polling_Proc();
kk = HID_Read();
if (kk != 0) {
for(cnt=0; cnt < 64; cnt++)
writebuff[cnt]=readbuff[cnt];
HID_Write(&writebuff,64);
}
}
Notes Do not use this functions with USB_Interrupt_Proc. To enable servicing by polling, USB_INTERRUPT
constant should be set to 0 (it is located in descriptor le).