Subversion Repositories group.electronics

Rev

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

Rev 76 Rev 77
Line 65... Line 65...
65
    0x16, 0x00, 0x80,		   //	  Log Min -32768
65
    0x16, 0x00, 0x80,		   //	  Log Min -32768
66
    0x26, 0xff, 0x7f,		   //	  Log max 32768
66
    0x26, 0xff, 0x7f,		   //	  Log max 32768
67
    0x75, 0x10,                    //     REPORT_SIZE (16)
67
    0x75, 0x10,                    //     REPORT_SIZE (16)
68
    0x95, 0x03,                    //     REPORT_COUNT (2)
68
    0x95, 0x03,                    //     REPORT_COUNT (2)
69
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
69
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
-
 
70
 
-
 
71
    0x05, 0x09,                    //     USAGE_PAGE (Button)
-
 
72
    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)
-
 
73
    0x29, 0x02,                    //     USAGE_MAXIMUM (Button 2)
-
 
74
    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
-
 
75
    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)
-
 
76
    0x75, 0x01,                    //     REPORT_SIZE (1)
-
 
77
    0x95, 0x02,                    //     REPORT_COUNT (2)
-
 
78
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
-
 
79
 
-
 
80
    0x75, 0x01,                    //     REPORT_SIZE (1)
-
 
81
    0x95, 0x06,                    //     REPORT_COUNT (6)
-
 
82
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
-
 
83
 
70
    0xc0,                          //   END_COLLECTION
84
    0xc0,                          //   END_COLLECTION
71
    0xc0                           // END_COLLECTION
85
    0xc0                           // END_COLLECTION
72
};
86
};
73
 
87
 
74
 
88
 
Line 209... Line 223...
209
    reportBuffer.axis0 = 0;
223
    reportBuffer.axis0 = 0;
210
    reportBuffer.axis1 = 0;
224
    reportBuffer.axis1 = 0;
211
    reportBuffer.axis2 = 0;
225
    reportBuffer.axis2 = 0;
212
    reportBuffer.buttons = 0;
226
    reportBuffer.buttons = 0;
213
 
227
 
214
 
-
 
215
 
-
 
216
 
-
 
217
 
-
 
218
    for(;;){    /* main event loop */
228
    for(;;){    /* main event loop */
219
        wdt_reset();
229
        wdt_reset();
220
        usbPoll();
230
        usbPoll();
221
 
231
 
222
        if(usbInterruptIsReady()){ 
232
        if(usbInterruptIsReady()){ 
223
		usbSendHidReport(&reportBuffer, sizeof(reportBuffer));
233
		usbSendHidReport(&reportBuffer, sizeof(reportBuffer));
-
 
234
    		reportBuffer.buttons = 0;
224
        }
235
        }
225
    }
236
    }
226
    return 0;
237
    return 0;
227
}
238
}
228
 
239
 
Line 244... Line 255...
244
                && rbi(pcInt[pcint].mask, PCINT4) ) {
255
                && rbi(pcInt[pcint].mask, PCINT4) ) {
245
 
256
 
246
                        if (reportBuffer.axis2 < 32500)
257
                        if (reportBuffer.axis2 < 32500)
247
                                reportBuffer.axis2 += 200;
258
                                reportBuffer.axis2 += 200;
248
 
259
 
-
 
260
			reportBuffer.b1 = 1;
249
 
261
 
250
        } else if (rbi(pcInt[pcint].current, PCINT3) == 0
262
        } else if (rbi(pcInt[pcint].current, PCINT3) == 0
251
                && rbi(pcInt[pcint].current, PCINT4) == 0
263
                && rbi(pcInt[pcint].current, PCINT4) == 0
252
                && rbi(pcInt[pcint].mask, PCINT3) ) {
264
                && rbi(pcInt[pcint].mask, PCINT3) ) {
253
 
265
 
254
                        if (reportBuffer.axis2 > -32500)
266
                        if (reportBuffer.axis2 > -32500)
255
                                reportBuffer.axis2 -= 200;
267
                                reportBuffer.axis2 -= 200;
256
 
268
 
-
 
269
			reportBuffer.b2 = 1;
257
 
270
 
258
        }
271
        }
259
 
272
 
260
        // Clear the mask so we know we've delth with it
273
        // Clear the mask so we know we've delth with it
261
        pcInt[pcint].mask = 0;
274
        pcInt[pcint].mask = 0;