|
@@ -29,11 +29,11 @@ section at the end of this file).
|
29
|
29
|
/* This is the port where the USB bus is connected. When you configure it to
|
30
|
30
|
* "B", the registers PORTB, PINB and DDRB will be used.
|
31
|
31
|
*/
|
32
|
|
-#define USB_CFG_DMINUS_BIT 4
|
|
32
|
+#define USB_CFG_DMINUS_BIT 3
|
33
|
33
|
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
|
34
|
34
|
* This may be any bit in the port.
|
35
|
35
|
*/
|
36
|
|
-#define USB_CFG_DPLUS_BIT 3
|
|
36
|
+#define USB_CFG_DPLUS_BIT 4
|
37
|
37
|
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
|
38
|
38
|
* This may be any bit in the port. Please note that D+ must also be connected
|
39
|
39
|
* to interrupt pin INT0! [You can also use other interrupts, see section
|
|
@@ -163,6 +163,11 @@ section at the end of this file).
|
163
|
163
|
* (besides debugging) is to flash a status LED on each packet.
|
164
|
164
|
*/
|
165
|
165
|
/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
|
|
166
|
+#ifndef __ASSEMBLER__
|
|
167
|
+#include <avr/interrupt.h> // for sei()
|
|
168
|
+#include "osccal.h" // for calibrateOscillator()
|
|
169
|
+#endif
|
|
170
|
+#define USB_RESET_HOOK(resetStarts) if(!resetStarts){cli(); calibrateOscillator(); sei();}
|
166
|
171
|
/* This macro is a hook if you need to know when an USB RESET occurs. It has
|
167
|
172
|
* one parameter which distinguishes between the start of RESET state and its
|
168
|
173
|
* end.
|
|
@@ -171,7 +176,7 @@ section at the end of this file).
|
171
|
176
|
/* This macro (if defined) is executed when a USB SET_ADDRESS request was
|
172
|
177
|
* received.
|
173
|
178
|
*/
|
174
|
|
-#define USB_COUNT_SOF 0
|
|
179
|
+#define USB_COUNT_SOF 1
|
175
|
180
|
/* define this macro to 1 if you need the global variable "usbSofCount" which
|
176
|
181
|
* counts SOF packets. This feature requires that the hardware interrupt is
|
177
|
182
|
* connected to D- instead of D+.
|
|
@@ -203,7 +208,7 @@ section at the end of this file).
|
203
|
208
|
* usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
|
204
|
209
|
* for each control- and out-endpoint to check for duplicate packets.
|
205
|
210
|
*/
|
206
|
|
-#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
|
|
211
|
+#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 1
|
207
|
212
|
/* define this macro to 1 if you want the function usbMeasureFrameLength()
|
208
|
213
|
* compiled in. This function can be used to calibrate the AVR's RC oscillator.
|
209
|
214
|
*/
|
|
@@ -382,5 +387,6 @@ section at the end of this file).
|
382
|
387
|
#define USB_INTR_ENABLE_BIT PCIE // Bit position in global interrupt enable register
|
383
|
388
|
#define USB_INTR_PENDING GIFR // Register to read interrupt flag
|
384
|
389
|
#define USB_INTR_PENDING_BIT PCIF // Bit position in register to read interrupt flag
|
|
390
|
+#define USB_INTR_VECTOR PCINT0_vect
|
385
|
391
|
|
386
|
392
|
#endif /* __usbconfig_h_included__ */
|