Subversion Repositories group.electronics

Rev

Rev 88 | Rev 90 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 88 Rev 89
Line 73... Line 73...
73
uchar	usbFunctionSetup(uchar data[8])
73
uchar	usbFunctionSetup(uchar data[8])
74
{
74
{
75
    usbRequest_t    *rq = (void *)data;
75
    usbRequest_t    *rq = (void *)data;
76
 
76
 
77
    //if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){ 
77
    //if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){ 
-
 
78
 
-
 
79
	sbi (PORTD, 4);	
78
		
80
		
79
        switch (rq->bRequest ) {
81
        switch (rq->bRequest ) {
80
			case USBRQ_HID_GET_REPORT):
82
		case USBRQ_HID_GET_REPORT:
81
				return sizeof(reportBuffer);
83
			return sizeof(reportBuffer);
82
			case USBRQ_HID_GET_IDLE:
84
		case USBRQ_HID_GET_IDLE:
83
				usbMsgPtr = &idleRate;
85
			usbMsgPtr = &idleRate;
84
				return 1;
86
			return 1;
85
			case USBRQ_HID_SET_IDLE:
87
		case USBRQ_HID_SET_IDLE:
86
				idleRate = rq->wValue.bytes[1];
88
			idleRate = rq->wValue.bytes[1];
87
				return 0;
89
			return 0;
88
			case USB_GET_LED_STATE: // send data to PC
90
		case USB_GET_LED_STATE: // send data to PC
89
				usbMsgPtr = currleds;
91
			usbMsgPtr = currleds;
90
				return sizeof(currleds);
92
			return sizeof(currleds);
91
			case USB_SET_LED_STATE: // modify reply buffer
93
		case USB_SET_LED_STATE: // modify reply buffer
92
				currleds = rq->wValue.bytes[0];
94
			//currleds = rq->wValue.bytes[0];
93
				//currleds = rq->wIndex.bytes[0];
95
			//currleds = rq->wIndex.bytes[0];
-
 
96
			currleds = 0xaa;
94
				return 0;
97
			return 0;
95
        }
98
        }
96
    //}else{
99
    //}else{
97
 
100
 
98
    //}
101
    //}
99
	return 0;
102
	return 0;