diff options
Diffstat (limited to 'Projects/XPLAINBridge')
-rw-r--r-- | Projects/XPLAINBridge/AVRISPDescriptors.c | 4 | ||||
-rw-r--r-- | Projects/XPLAINBridge/AVRISPDescriptors.h | 15 | ||||
-rw-r--r-- | Projects/XPLAINBridge/XPLAINBridge.c | 18 | ||||
-rw-r--r-- | Projects/XPLAINBridge/XPLAINBridge.txt | 7 | ||||
-rw-r--r-- | Projects/XPLAINBridge/makefile | 2 |
5 files changed, 36 insertions, 10 deletions
diff --git a/Projects/XPLAINBridge/AVRISPDescriptors.c b/Projects/XPLAINBridge/AVRISPDescriptors.c index e19178391..30e72e9e3 100644 --- a/Projects/XPLAINBridge/AVRISPDescriptors.c +++ b/Projects/XPLAINBridge/AVRISPDescriptors.c @@ -106,7 +106,7 @@ AVRISP_USB_Descriptor_Configuration_t PROGMEM AVRISP_ConfigurationDescriptor = {
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AVRISP_DATA_EPNUM),
+ .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | AVRISP_DATA_IN_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AVRISP_DATA_EPSIZE,
.PollingIntervalMS = 0x00
@@ -116,7 +116,7 @@ AVRISP_USB_Descriptor_Configuration_t PROGMEM AVRISP_ConfigurationDescriptor = {
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AVRISP_DATA_EPNUM),
+ .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | AVRISP_DATA_OUT_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = AVRISP_DATA_EPSIZE,
.PollingIntervalMS = 0x00
diff --git a/Projects/XPLAINBridge/AVRISPDescriptors.h b/Projects/XPLAINBridge/AVRISPDescriptors.h index 7287ce639..2fa18095d 100644 --- a/Projects/XPLAINBridge/AVRISPDescriptors.h +++ b/Projects/XPLAINBridge/AVRISPDescriptors.h @@ -42,9 +42,20 @@ #include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the AVRISP bidirectional data endpoint. */
- #define AVRISP_DATA_EPNUM 2
+ #if !defined(LIBUSB_FILTERDRV_COMPAT)
+ /** Endpoint number of the AVRISP data OUT endpoint. */
+ #define AVRISP_DATA_OUT_EPNUM 2
+ /** Endpoint number of the AVRISP data IN endpoint. */
+ #define AVRISP_DATA_IN_EPNUM 2
+ #else
+ /** Endpoint number of the AVRISP data OUT endpoint. */
+ #define AVRISP_DATA_OUT_EPNUM 2
+
+ /** Endpoint number of the AVRISP data IN endpoint. */
+ #define AVRISP_DATA_IN_EPNUM 3
+ #endif
+
/** Size in bytes of the AVRISP data endpoint. */
#define AVRISP_DATA_EPSIZE 64
diff --git a/Projects/XPLAINBridge/XPLAINBridge.c b/Projects/XPLAINBridge/XPLAINBridge.c index e5b282ee5..7ca94b273 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.c +++ b/Projects/XPLAINBridge/XPLAINBridge.c @@ -99,7 +99,7 @@ void AVRISP_Task(void) if (USB_DeviceState != DEVICE_STATE_Configured)
return;
- Endpoint_SelectEndpoint(AVRISP_DATA_EPNUM);
+ Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM);
/* Check to see if a V2 Protocol command has been received */
if (Endpoint_IsOUTReceived())
@@ -178,18 +178,24 @@ void SetupHardware(void) /** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
- bool EndpointConfigSuccess;
+ bool EndpointConfigSuccess = true;
/* Configure the device endpoints according to the selected mode */
if (CurrentFirmwareMode == MODE_USART_BRIDGE)
{
- EndpointConfigSuccess = CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);
+ EndpointConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);
}
else
{
- EndpointConfigSuccess = Endpoint_ConfigureEndpoint(AVRISP_DATA_EPNUM, EP_TYPE_BULK,
- ENDPOINT_DIR_OUT, AVRISP_DATA_EPSIZE,
- ENDPOINT_BANK_SINGLE);
+ EndpointConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_OUT, AVRISP_DATA_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+
+ #if defined(WIN_LIBUSB_COMPAT)
+ EndpointConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK,
+ ENDPOINT_DIR_IN, AVRISP_DATA_EPSIZE,
+ ENDPOINT_BANK_SINGLE);
+ #endif
}
if (EndpointConfigSuccess)
diff --git a/Projects/XPLAINBridge/XPLAINBridge.txt b/Projects/XPLAINBridge/XPLAINBridge.txt index f967d3b76..cd8efbc10 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.txt +++ b/Projects/XPLAINBridge/XPLAINBridge.txt @@ -78,5 +78,12 @@ * <td>RingBuff.h</td>
* <td>Defines the maximum number of bytes which can be buffered in each Ring Buffer.</td>
* </tr>
+ * <tr>
+ * <td>WIN_LIBUSB_COMPAT</td>
+ * <td>Makefile CDEFS</td>
+ * <td>Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making
+ * the code compatible with Windows builds of avrdude using the libUSB driver. Linux platforms are not affected by this
+ * option.
+ * </tr>
* </table>
*/
\ No newline at end of file diff --git a/Projects/XPLAINBridge/makefile b/Projects/XPLAINBridge/makefile index ba87e8a1f..dfecaa2d5 100644 --- a/Projects/XPLAINBridge/makefile +++ b/Projects/XPLAINBridge/makefile @@ -202,6 +202,8 @@ CDEFS += -DAUX_LINE_PIN=PINB CDEFS += -DAUX_LINE_DDR=DDRB
CDEFS += -DAUX_LINE_MASK="(1 << 4)"
CDEFS += -DVTARGET_ADC_CHANNEL=2
+#CDEFS += -DLIBUSB_FILTERDRV_COMPAT
+
# Place -D or -U options here for ASM sources
ADEFS = -DF_CPU=$(F_CPU)
|