Subversion Repositories group.electronics

Rev

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

Rev 80 Rev 81
Line 14... Line 14...
14
#include <avr/interrupt.h>
14
#include <avr/interrupt.h>
15
#include <avr/pgmspace.h>
15
#include <avr/pgmspace.h>
16
#include <util/delay.h>
16
#include <util/delay.h>
17
 
17
 
18
#include "usbdrv.h"
18
#include "usbdrv.h"
19
#include "oddebug.h"
19
//#include "oddebug.h"
20
#include "config.h"
20
#include "config.h"
21
 
21
 
22
#ifndef NULL
22
#ifndef NULL
23
#define NULL    ((void *)0)
23
#define NULL    ((void *)0)
24
#endif
24
#endif
25
 
25
 
26
/* ------------------------------------------------------------------------- */
26
/* ------------------------------------------------------------------------- */
27
 
27
 
28
struct {
28
struct {
29
	union {
29
	union {
30
		int16_t axis[2];
30
		int16_t axis[1];
31
		struct {
31
		struct {
32
			int16_t axis0:16;
32
			int16_t axis0:16;
33
			int16_t axis1:16;
33
			//int16_t axis1:16;
34
		};
34
		};
35
		uint8_t buttons;
35
		uint8_t buttons;
36
		struct {
36
		struct {
37
			int8_t b1:1;
37
			int8_t b1:1;
38
			int8_t b2:2;
38
			int8_t b2:2;
Line 203... Line 203...
203
  */
203
  */
204
  DDRD          = 0B01000000;
204
  DDRD          = 0B01000000;
205
  PORTD         = 0B00000000;
205
  PORTD         = 0B00000000;
206
 
206
 
207
 
207
 
208
    odDebugInit();
208
    //odDebugInit();
209
    usbDeviceDisconnect();
209
    usbDeviceDisconnect();
210
    for(i=0;i<20;i++){  /* 300 ms disconnect */
210
    for(i=0;i<20;i++){  /* 300 ms disconnect */
211
        _delay_ms(15);
211
        _delay_ms(15);
212
    }
212
    }
213
 
213
 
Line 221... Line 221...
221
 
221
 
222
    usbInit();
222
    usbInit();
223
    sei();
223
    sei();
224
 
224
 
225
    reportBuffer.axis0 = 0;
225
    reportBuffer.axis0 = 0;
226
    reportBuffer.axis1 = 0;
226
    //reportBuffer.axis1 = 0;
227
    reportBuffer.buttons = 0;
227
    reportBuffer.buttons = 0;
228
 
228
 
229
	PORTB = 0xaa;
229
	PORTB = 0xaa;
230
 
230
 
231
    for(;;){    /* main event loop */
231
    for(;;){    /* main event loop */