forked from jimmo/numato-mimasv2-pic-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
usb_events.c
48 lines (35 loc) · 896 Bytes
/
usb_events.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <xc.h>
#include "system.h"
#include "usb.h"
#include "usb_device.h"
#include "usb_device_cdc.h"
bool USER_USB_CALLBACK_EVENT_HANDLER(USB_EVENT event, void *pdata, uint16_t size) {
USBCDCEventHandler(event, pdata, size);
switch( (int) event )
{
case EVENT_TRANSFER:
break;
case EVENT_SOF:
break;
case EVENT_SUSPEND:
break;
case EVENT_RESUME:
break;
case EVENT_CONFIGURED:
CDCInitEP(0, 0, 1, 1, 2);
CDCInitEP(1, 2, 3, 3, 4);
break;
case EVENT_SET_DESCRIPTOR:
break;
case EVENT_EP0_REQUEST:
USBCheckCDCRequest();
break;
case EVENT_BUS_ERROR:
break;
case EVENT_TRANSFER_TERMINATED:
break;
default:
break;
}
return true;
}