Skip to content

Commit 0d644d7

Browse files
committed
Removed unused code
1 parent 533d7cc commit 0d644d7

File tree

2 files changed

+1
-42
lines changed

2 files changed

+1
-42
lines changed

cores/arduino/USB/CDC.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ int Serial_::read(void)
243243
unsigned char c = buffer->buffer[buffer->tail];
244244
buffer->tail = (uint32_t)(buffer->tail + 1) % CDC_SERIAL_BUFFER_SIZE;
245245
buffer->full = false;
246-
// if (usb.available(CDC_ENDPOINT_OUT))
247-
// accept();
246+
248247
return c;
249248
}
250249
}

cores/arduino/USB/USBCore.cpp

-40
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ void USBDeviceClass::handleEndpoint(uint8_t ep)
253253
#if defined(CDC_ENABLED)
254254
if (ep == CDC_ENDPOINT_OUT)
255255
{
256-
// The RAM Buffer is empty: we can receive data
257-
//usbd.epBank0ResetReady(CDC_ENDPOINT_OUT);
258-
259256
// Handle received bytes
260257
if (available(CDC_ENDPOINT_OUT))
261258
SerialUSB.accept();
@@ -454,10 +451,6 @@ void USBDeviceClass::initEP(uint32_t ep, uint32_t config)
454451
}
455452
else if (config == USB_ENDPOINT_TYPE_CONTROL)
456453
{
457-
// XXX: Needed?
458-
// usbd.epBank0DisableAutoZLP(ep);
459-
// usbd.epBank1DisableAutoZLP(ep);
460-
461454
// Setup Control OUT
462455
usbd.epBank0SetSize(ep, 64);
463456
usbd.epBank0SetAddress(ep, &udd_ep_out_cache_buffer[ep]);
@@ -613,39 +606,6 @@ uint32_t USBDeviceClass::send(uint32_t ep, const void *data, uint32_t len)
613606
if (len > 16384)
614607
return -1;
615608

616-
#if 0
617-
// This shortcut has some issues:
618-
// - sometimes it fails when sending an odd number of bytes (may be
619-
// due to memory alignment?)
620-
// - the data pointer should point to "stable" data (and this is not
621-
// guaranteed by caller, it may be some sort of temporary buffer)
622-
// - the SRAM is not guaranteed to start at 0x20000000
623-
624-
// All the above problems must be properly fixed before reenabling
625-
// this part
626-
627-
if ((unsigned int)data > 0x20000000)
628-
{
629-
// Buffer in RAM
630-
usbd.epBank1SetAddress(ep, (void *)data);
631-
usbd.epBank1SetMultiPacketSize(ep, 0);
632-
633-
usbd.epBank1SetByteCount(ep, len);
634-
635-
// Clear the transfer complete flag
636-
usbd.epBank1AckTransferComplete(ep);
637-
638-
// RAM buffer is full, we can send data (IN)
639-
usbd.epBank1SetReady(ep);
640-
641-
// Wait for transfer to complete
642-
while (!usbd.epBank1IsTransferComplete(ep)) {
643-
; // need fire exit.
644-
}
645-
return 0;
646-
}
647-
#endif
648-
649609
#ifdef PIN_LED_TXL
650610
digitalWrite(PIN_LED_TXL, LOW);
651611
txLEDPulse = TX_RX_LED_PULSE_MS;

0 commit comments

Comments
 (0)