Commit graph

119 commits

Author SHA1 Message Date
ladyada
4d8adc9be4 Merge branch 'master' of https://github.com/arduino/ArduinoCore-samd into arduino-master 2019-03-08 14:03:54 -05:00
Sandeep Mistry
9d83af3e05 Fix USB warnings 2018-11-27 09:39:36 -05:00
ladyada
074fe0fa9b re-set to 100mA default for iOS support 2018-11-02 13:48:39 -04:00
gdsports
9ac80d9a3a Fix memory overwrite in USBHost
Fix issue #271.
2018-10-23 11:31:34 +02:00
Martino Facchin
3b38a41278 Inplement USBDevice.end() 2018-10-23 11:19:08 +02:00
Martino Facchin
d5557ec4b4 Clear _usbLineInfo structure on SerialUSB.end() 2018-10-23 11:19:08 +02:00
dean
bcc44cc6a1 DM: samd51 USB fix for rebase 2018-09-04 11:50:37 -04:00
dean
b7e942d924 DM: fix stuff from rebase 2018-08-30 15:40:15 -04:00
dean
87eae6f55c DM: add copyrights 2018-08-30 15:12:51 -04:00
dean
7f74c2126e update usb stuff 2018-08-30 15:08:16 -04:00
dean
2b0f87a73d DM: some usb host fixes (still not working) 2018-08-30 14:59:17 -04:00
dean
9eecac827b DM: updates for rev B 2018-08-30 14:59:16 -04:00
dean
c1827b289d DM: added support for samd51J20A 2018-08-30 14:46:42 -04:00
dean
4810822d26 DM: mostly fixed usb enumeration delay 2018-08-30 14:44:35 -04:00
dean
b5c2b6483b DM: clocked to 120MHZ, peripherals to 100, USB to 48 2018-08-30 14:44:35 -04:00
dean
358b11addd DM: added samd51 support 2018-08-30 14:32:21 -04:00
ladyada
b34deb4e81 align back to mainline (and put in missing Serial5) - not sure if USB serial LEDs were causing hangups on 1200baud bumps? :/ 2018-08-30 14:23:07 -04:00
ladyada
d19c8e35a9 cleaned up slight difference in USB union bitflags with a new USBDevice.h - compiles blink 2018-08-30 14:21:26 -04:00
ladyada
ae249718d4 add USB CDC RX & TX LEDs with 10ms minimum on time, tested 2018-08-30 14:18:05 -04:00
ladyada
012d86c1d3 make it so native USB is Serial 2018-08-30 14:12:25 -04:00
Martino Facchin
f4dfac890f Always call new DoubleBufferedEPOutHandler on reconnect
Avoid memory leak by deleting the buffers; DoubleBufferedEPOutHandler should be refactored (in beta branch) to allow separate "new" and "setup" procedures

Fixes #350
2018-08-24 12:24:49 +02:00
gdsports
95bcb7cf3a Fix CDC_ENABLED
Undefining CDC_ENABLED triggered a compiler error. With this fix, the
CDC ACM configuration can be disabled.
2018-02-20 16:49:11 -05:00
Martino Facchin
2bb54068a2 Don't reallocate USB buffers if already allocated
USB Configuration was meant to run only once, but if the board comes back from standby the host can reconfigure the device again.
Probably a cleaner patch could be free()-ing the buffers on standby() to release the memory but at least we don't leak anymore.

Fixes https://github.com/arduino/ArduinoCore-samd/issues/293
2018-01-25 11:20:41 -05:00
Sandeep Mistry
d58b840f63 Add missing USBCON wrapper 2018-01-08 10:41:14 -05:00
Andreas Watterott
7e37bb3b12
No fixed value for USB power current. 2017-11-09 19:50:41 +01:00
Sandeep Mistry
0ee62489c0 Replace utoa + toupper with custom loop 2017-08-23 19:21:01 +02:00
Sandeep Mistry
61b060c732 Slim serial number to hex string conversion 2017-08-23 19:21:01 +02:00
Sandeep Mistry
9370464ad0 Use SAMD21 serial number for USB serial number prefix 2017-08-23 19:21:01 +02:00
Sandeep Mistry
70b011b077 USB: Only swap incoming buffers for non-ZLP's 2017-05-02 10:01:03 -04:00
Martino Facchin
b9ac48c782 Implement low power functionality on USB subsystem
This enables remote wakeup on CDC driver, so we can safely call standby() and maintain the Serial prints on resume.
2017-04-04 10:50:22 +02:00
Cristian Maglie
428433f963 Merge branch 'bootloader-cmsis-fix' 2016-12-20 16:59:12 +01:00
Sandeep Mistry
80f629c379 Correct epBank1EnableTransferComplete 2016-12-19 16:30:52 -05:00
Martino Facchin
86ae860677 Enlarge USB serialNumber buffer 2016-12-15 18:34:05 +01:00
Sandeep Mistry
38683e36b6 Changes required for new CMSIS package upgrade
Fixes some compile errors and warnings
2016-12-02 10:48:52 -05:00
Cristian Maglie
b06501baee Fix regression: SerialUSB.available() do not return correct values
Fix #172
2016-10-10 12:43:14 +02:00
Sandeep Mistry
b2462a5a1a Remove line state check in Serial_::write
It’s no longer needed with the timeout mechanism in USBCore.
2016-08-31 11:21:40 -04:00
Sandeep Mistry
8f7873cea5 Add comment on inspiration 2016-08-31 11:21:40 -04:00
Sandeep Mistry
8afe969ed2 Make transmit timeout per endpoint 2016-08-31 11:21:40 -04:00
Sandeep Mistry
b627e00b17 Add USB send timeout
Timeout is checked on the next send attempt. Initial timeout is set to
70ms, after a time out occurs and the previous transfer is still not
complete a send will report as failed. If a send times out, a ZLP will
be in the send queue to check for future timeouts.
2016-08-31 11:21:40 -04:00
Cristian Maglie
5dd2adc41d USBD: Rewritten RX/TX LED conditions in a slighlty more clear way 2016-08-29 17:06:56 +02:00
Cristian Maglie
0605c11e76 USBD: RX LED now blinks again (fixed regression) 2016-08-29 17:05:16 +02:00
Cristian Maglie
4691ef4ba0 USB: Added optimized Stream::readBytes for EP OUT handler
This bypass the generic (but inefficient) implementation of Stream::readBytes
and uses an optimized version of readBytes than can do efficient multi-byte reads.
2016-08-24 12:50:37 +02:00
Cristian Maglie
3127d1dc51 USB-CDC: Increased buffer size to 256 bytes
This change improves read performance when massive data is sent
via USB by exploiting the hardware capability to handle multi-packet
transfers autonomously.
2016-08-24 12:50:25 +02:00
Cristian Maglie
5265e1215a USB: EP0 ::recv method has been merged with ::read method
It makes no sense to have ::recv calling repeatedly ::read in this
case.
2016-08-24 12:37:27 +02:00
Cristian Maglie
2e44a4d961 USBD: Added critical sections to EP OUT handler 2016-08-24 01:04:58 +02:00
Cristian Maglie
a9127228d6 USB: Slightly refactored EP OUT handler
Now the release() function only performs the action that is called for,
i.e. release the endpoint and let it receive data. All the buffers handling
has been inlined in the callers, this also slightly improves performance
because it allows to remove some redundant checks.
2016-08-24 01:04:58 +02:00
Cristian Maglie
87bf6e1bf1 Fixed some comments 2016-08-24 01:04:58 +02:00
Cristian Maglie
3ba1a35296 Moved EPHandler in USBDevice headers
The reference to the upper USBDevice class is passed on
the EPHandler constructor.
2016-08-24 01:04:58 +02:00
Cristian Maglie
7d37753904 USB-CDC: OUT EP is now handled with a custom EPHandler 2016-08-24 01:04:58 +02:00
Cristian Maglie
9f24bbe9a8 USB: Added an OUT EP handler with double buffering. 2016-08-24 01:04:58 +02:00