diff --git a/hardware/arduino/sam/cores/arduino/USB/CDC.cpp b/hardware/arduino/sam/cores/arduino/USB/CDC.cpp index 64271b1f8..3c4f9feaf 100644 --- a/hardware/arduino/sam/cores/arduino/USB/CDC.cpp +++ b/hardware/arduino/sam/cores/arduino/USB/CDC.cpp @@ -228,7 +228,6 @@ size_t Serial_::write(uint8_t c) if (r > 0) { - USBD_Flush(CDC_TX); return r; } else { diff --git a/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp b/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp index 3b4a2ced4..61113c20b 100644 --- a/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp +++ b/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp @@ -397,6 +397,12 @@ static void USB_ISR(void) udd_ack_fifocon(CDC_RX); } + + if (Is_udd_sof()) + { + udd_ack_sof(); + USBD_Flush(CDC_TX); + } #endif // EP 0 Interrupt diff --git a/hardware/arduino/sam/system/libsam/source/uotghs_device.c b/hardware/arduino/sam/system/libsam/source/uotghs_device.c index 23e815ccb..dff259658 100644 --- a/hardware/arduino/sam/system/libsam/source/uotghs_device.c +++ b/hardware/arduino/sam/system/libsam/source/uotghs_device.c @@ -115,7 +115,7 @@ void UDD_Attach(void) // Enable USB line events udd_enable_reset_interrupt(); - //udd_enable_sof_interrupt(); + udd_enable_sof_interrupt(); cpu_irq_restore(flags); } diff --git a/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a b/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a index a25e77ed9..8488d4ee5 100644 Binary files a/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a and b/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a differ