Thu, 16 Feb 2017 16:24:52 +0100
gnf..... merge
1
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
1 | /* Name: main.c |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
2 | * Project: hid-data, example how to use HID for data transfer |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
3 | * Author: Christian Starkjohann |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
4 | * Creation Date: 2008-04-11 |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
5 | * Tabsize: 4 |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
6 | * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
8 | */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
9 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
10 | /* |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
11 | This example should run on most AVRs with only little changes. No special |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
12 | hardware resources except INT0 are used. You may have to change usbconfig.h for |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
13 | different I/O pins for USB. Please note that USB D+ must be the INT0 pin, or |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
14 | at least be connected to INT0 as well. |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
15 | */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
16 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
17 | #include <avr/io.h> |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
18 | #include <avr/wdt.h> |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
19 | #include <avr/interrupt.h> /* for sei() */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
20 | #include <util/delay.h> /* for _delay_ms() */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
21 | #include <avr/eeprom.h> |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
22 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
23 | #include <avr/pgmspace.h> /* required by usbdrv.h */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
24 | #include "usbdrv.h" |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
25 | #include "oddebug.h" /* This is also an example for using debug macros */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
26 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
27 | /* ------------------------------------------------------------------------- */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
28 | /* ----------------------------- USB interface ----------------------------- */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
29 | /* ------------------------------------------------------------------------- */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
30 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
31 | PROGMEM const char usbHidReportDescriptor[22] = { /* USB report descriptor */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
32 | 0x06, 0x00, 0xff, // USAGE_PAGE (Generic Desktop) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
33 | 0x09, 0x01, // USAGE (Vendor Usage 1) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
34 | 0xa1, 0x01, // COLLECTION (Application) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
35 | 0x15, 0x00, // LOGICAL_MINIMUM (0) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
36 | 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
37 | 0x75, 0x08, // REPORT_SIZE (8) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
38 | 0x95, 0x80, // REPORT_COUNT (128) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
39 | 0x09, 0x00, // USAGE (Undefined) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
40 | 0xb2, 0x02, 0x01, // FEATURE (Data,Var,Abs,Buf) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
41 | 0xc0 // END_COLLECTION |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
42 | }; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
43 | /* Since we define only one feature report, we don't use report-IDs (which |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
44 | * would be the first byte of the report). The entire report consists of 128 |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
45 | * opaque data bytes. |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
46 | */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
47 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
48 | /* The following variables store the status of the current data transfer */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
49 | static uchar currentAddress; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
50 | static uchar bytesRemaining; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
51 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
52 | /* ------------------------------------------------------------------------- */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
53 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
54 | /* usbFunctionRead() is called when the host requests a chunk of data from |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
55 | * the device. For more information see the documentation in usbdrv/usbdrv.h. |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
56 | */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
57 | uchar usbFunctionRead(uchar *data, uchar len) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
58 | { |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
59 | if(len > bytesRemaining) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
60 | len = bytesRemaining; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
61 | // eeprom_read_block(data, (uchar *)0 + currentAddress, len); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
62 | currentAddress += len; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
63 | bytesRemaining -= len; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
64 | return len; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
65 | } |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
66 | /* usbFunctionWrite() is called when the host sends a chunk of data to the |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
67 | * device. For more information see the documentation in usbdrv/usbdrv.h. |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
68 | */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
69 | uchar usbFunctionWrite(uchar *data, uchar len) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
70 | { |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
71 | if(bytesRemaining == 0) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
72 | return 1; /* end of transfer */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
73 | if(len > bytesRemaining) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
74 | len = bytesRemaining; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
75 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
76 | // eeprom_write_block(data, (uchar *)0 + currentAddress, len); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
77 | uint8_t *tmp = data; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
78 | OCR0A = *tmp; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
79 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
80 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
81 | currentAddress += len; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
82 | bytesRemaining -= len; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
83 | return bytesRemaining == 0; /* return 1 if this was the last chunk */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
84 | } |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
85 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
86 | /* ------------------------------------------------------------------------- */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
87 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
88 | usbMsgLen_t usbFunctionSetup(uchar data[8]) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
89 | { |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
90 | usbRequest_t *rq = (void *)data; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
91 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
92 | if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){ /* HID class request */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
93 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
94 | // if(rq->bRequest == USBRQ_HID_GET_REPORT){ /* wValue: ReportType (highbyte), ReportID (lowbyte) */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
95 | /* since we have only one report type, we can ignore the report-ID */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
96 | // bytesRemaining = 128; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
97 | // currentAddress = 0; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
98 | // return USB_NO_MSG; /* use usbFunctionRead() to obtain data */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
99 | // }else |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
100 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
101 | if(rq->bRequest == USBRQ_HID_SET_REPORT){ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
102 | /* since we have only one report type, we can ignore the report-ID */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
103 | bytesRemaining = 1; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
104 | currentAddress = 0; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
105 | return USB_NO_MSG; /* use usbFunctionWrite() to receive data from host */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
106 | } |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
107 | }else{ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
108 | /* ignore vendor type requests, we don't use any */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
109 | } |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
110 | return 0; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
111 | } |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
112 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
113 | /* ------------------------------------------------------------------------- */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
114 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
115 | int main(void) |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
116 | { |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
117 | uchar i; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
118 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
119 | wdt_enable(WDTO_1S); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
120 | /* Even if you don't use the watchdog, turn it off here. On newer devices, |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
121 | * the status of the watchdog (on/off, period) is PRESERVED OVER RESET! |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
122 | */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
123 | /* RESET status: all port bits are inputs without pull-up. |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
124 | * That's the way we need D+ and D-. Therefore we don't need any |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
125 | * additional hardware initialization. |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
126 | */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
127 | //odDebugInit(); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
128 | //DBG1(0x00, 0, 0); /* debug output: main starts */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
129 | usbInit(); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
130 | usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
131 | i = 0; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
132 | while(--i){ /* fake USB disconnect for > 250 ms */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
133 | wdt_reset(); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
134 | _delay_ms(1); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
135 | } |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
136 | usbDeviceConnect(); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
137 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
138 | DDRB |= (1 << PB2); // PWM output on PB2 |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
139 | TCCR0A = (1 << COM0A1) | (1 << WGM00); // phase correct PWM mode |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
140 | OCR0A = 0x10; // initial PWM pulse width |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
141 | TCCR0B = (1 << CS01); // clock source = CLK/8, start PWM |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
142 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
143 | sei(); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
144 | //DBG1(0x01, 0, 0); /* debug output: main loop starts */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
145 | for(;;){ /* main event loop */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
146 | //DBG1(0x02, 0, 0); /* debug output: main loop iterates */ |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
147 | wdt_reset(); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
148 | usbPoll(); |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
149 | } |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
150 | return 0; |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
151 | } |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
152 | |
31032bc7b0e6
added firmware and python client
Malte Di Donato <mdd@neo-soft.org>
parents:
diff
changeset
|
153 | /* ------------------------------------------------------------------------- */ |