From 9df3b6aeaf78ab20ce41095734718833525f2171 Mon Sep 17 00:00:00 2001 From: Adrian Woodley Date: Wed, 6 Jun 2018 00:23:32 +0800 Subject: [PATCH] Correct config settings. --- usbdrv/usbconfig.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/usbdrv/usbconfig.h b/usbdrv/usbconfig.h index 31b10ee..a02b6ca 100644 --- a/usbdrv/usbconfig.h +++ b/usbdrv/usbconfig.h @@ -27,11 +27,11 @@ section at the end of this file). /* This is the port where the USB bus is connected. When you configure it to * "B", the registers PORTB, PINB and DDRB will be used. */ -#define USB_CFG_DMINUS_BIT 4 +#define USB_CFG_DMINUS_BIT 3 /* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. * This may be any bit in the port. */ -#define USB_CFG_DPLUS_BIT 3 +#define USB_CFG_DPLUS_BIT 4 /* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. * This may be any bit in the port. Please note that D+ must also be connected * to interrupt pin INT0! [You can also use other interrupts, see section @@ -107,7 +107,7 @@ section at the end of this file). * (e.g. HID), but never want to send any data. This option saves a couple * of bytes in flash memory and the transmit buffers in RAM. */ -#define USB_CFG_INTR_POLL_INTERVAL 100 +#define USB_CFG_INTR_POLL_INTERVAL 10 /* If you compile a version with endpoint 1 (interrupt-in), this is the poll * interval. The value is in milliseconds and must not be less than 10 ms for * low speed devices. @@ -116,7 +116,7 @@ section at the end of this file). /* Define this to 1 if the device has its own power supply. Set it to 0 if the * device is powered from the USB bus. */ -#define USB_CFG_MAX_BUS_POWER 20 +#define USB_CFG_MAX_BUS_POWER 100 /* Set this variable to the maximum USB bus power consumption of your device. * The value is in milliamperes. [It will be divided by two since USB * communicates power requirements in units of 2 mA.] @@ -282,7 +282,7 @@ extern void hadUsbReset(void); // define the function for usbdrv.c * CDC class is 2, use subclass 2 and protocol 1 for ACM */ /* #define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 42 */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 52 +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 56 /* Define this to the length of the HID report descriptor, if you implement * an HID device. Otherwise don't define it or define it to 0. * If you use this define, you must add a PROGMEM character array named @@ -374,5 +374,13 @@ extern void hadUsbReset(void); // define the function for usbdrv.c /* #define USB_INTR_PENDING GIFR */ /* #define USB_INTR_PENDING_BIT INTF0 */ /* #define USB_INTR_VECTOR INT0_vect */ +#define USB_INTR_CFG PCMSK +#define USB_INTR_CFG_SET (1 << USB_CFG_DPLUS_BIT) +#define USB_INTR_CFG_CLR 0 +#define USB_INTR_ENABLE GIMSK +#define USB_INTR_ENABLE_BIT PCIE +#define USB_INTR_PENDING GIFR +#define USB_INTR_PENDING_BIT PCIF +#define USB_INTR_VECTOR PCINT0_vect #endif /* __usbconfig_h_included__ */