Commit Graph

59 Commits

Author SHA1 Message Date
Dan Halbert
6b18a51d57 wip: working on descriptor templates 2021-04-20 22:20:34 -04:00
Dan Halbert
51ccf8dc30 wip: revert usb_descriptor changes; use raw descriptors instead 2021-04-19 23:24:18 -04:00
Dan Halbert
4a7e129287 wip: latent usb device enabling/disabling 2021-04-13 23:33:44 -04:00
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Radomir Dopieralski
8c8d60fb80 Fix for CIRCUITPY_USB_MSC=0
Avoid undefined functions when MSC is disabled.
2021-02-27 15:05:00 +01:00
Kamil Tomaszewski
ef3a61432b Add the missing argument to the HID functions 2021-02-24 19:09:17 +01:00
Jeff Epler
aa1de69645 fix length of generated serial number descriptor 2021-02-22 07:33:04 -06:00
Jeff Epler
144acfcb98 USB descriptors: Save flash storage for serial number
This saves about 60 bytes (Feather M4 went from 45040 -> 45100 bytes free)
66 bytes of data eliminated, but 6 bytes paid back to initialize the length
field.
2021-02-21 21:24:49 -06:00
Dan Halbert
e344c6d684 fix some builds 2021-02-18 14:24:58 -05:00
Dan Halbert
0b8f1b9a90 wip: usb_cdc.serials 2021-02-15 20:06:18 -05:00
Dan Halbert
f0564b4986 merge from upstream; complicated webusb merge 2021-02-11 18:50:02 -05:00
Dan Halbert
5bb722b927
Merge pull request #4122 from hathach/fix-3986
Fix 3986 background reset remove existing usb callback
2021-02-05 09:13:28 -05:00
Dan Halbert
0802b22ed6 usb descriptors all set; rework of enabling for USB devices 2021-02-04 19:23:40 -05:00
hathach
8d7b1f9e8c add usb_background_schedule()
unconditionally schedule usb background after
background_callback_reset()
2021-02-04 16:00:14 +07:00
Kevin Banks
215a56c920 Merge branch 'main' into webusb (trying to get CI back online) 2021-02-03 16:48:28 -06:00
hathach
e699a59890 hack to fix 3986
just a proof to show that issue analysis is correct
2021-02-03 11:01:33 +07:00
Kevin Banks
1b031508e1 BOS and MS_OS_2.0 descriptors have been added. Still more descriptor work TODO. 2021-01-26 20:43:19 -06:00
Kevin Banks
fbfb7b68cc Most of the code we need has been pulled in from the tinyusb webusb_serial demo. Still LOTS to do regarding descriptors. 2021-01-25 20:37:58 -06:00
Scott Shawcroft
b73b30ff9f
Switch to upstream TinyUSB 2021-01-21 11:33:13 -08:00
Dan Halbert
3b4c14f3ec unmounted filesystems start as ejected 2020-12-21 20:43:46 -05:00
Dan Halbert
a0f1ec3c4a wip 2020-11-22 19:10:09 -05:00
Dan Halbert
39e1f52e28 wip; not compiling yet 2020-11-19 17:47:12 -05:00
Dan Halbert
ffff02c053 Merge remote-tracking branch 'adafruit/main' into sleep 2020-11-16 12:06:11 -05:00
Dan Halbert
bb77f1d130 wip: initial code changes, starting from @tannewt's sleepio branch 2020-11-16 11:56:20 -05:00
Scott Shawcroft
bda3267432
Save flash space
* No weak link for modules. It only impacts _os and _time and is
  already disabled for non-full builds.
* Turn off PA00 and PA01 because they are the crystal on the Metro
  M0 Express.
* Change ejected default to false to move it to BSS. It is set on
  USB connection anyway.
* Set sinc_filter to const. Doesn't help flash but keeps it out of
  RAM.
2020-11-13 18:57:52 -08:00
Dan Halbert
345d84ffde improve USB CDC disconnect/reconnect checking 2020-10-30 22:25:50 -04:00
Scott Shawcroft
9a4efed8cb
Start tweaking the workflow to sleep 2020-10-27 17:55:03 -07:00
Jeff Epler
28043c94b5 supervisor: Improve serial connection detection
These changes remove the caveat from supervisor.runtime.serial_connected.

It appears that _tud_cdc_connected() only tracks explicit changes to the
"DTR" bit, which leads to disconnects not being registered.

Instead:
 * when line state is changed explicitly, track the dtr value in
   _serial_connected
 * when the USB bus is suspended, set _serial_connected to False

Testing performed (using sam e54 xplained):  Run a program to show
the state of `serial_connected` on the LED:
```
import digitalio
import supervisor
import board

led = digitalio.DigitalInOut(board.LED)
while True:
    led.switch_to_output(not supervisor.runtime.serial_connected)
```

Try all the following:
 * open, close serial terminal program
    - LED status tracks whether terminal is open
 * turn on/off data lines using the switchable charge-only cable
    - LED turns off when switch is in "charger" position
    - LED turns back on when switch is in Data position and terminal is
      opened (but doesn't turn back on just because switch position is
      changed)
2020-09-17 18:32:06 -05:00
Jeff Epler
d4801b8c54
Merge pull request #3225 from hathach/improve-highspeed-usb
Improve highspeed usb
2020-07-30 07:15:20 -05:00
Scott Shawcroft
b76d37f24a
Merge pull request #3223 from dhalbert/unmount-before-reset
storage.erase_filesystem(): disconnect from USB and wait 1 second before resetting
2020-07-29 10:47:24 -07:00
hathach
1f4fcb399b
move CFG_TUSB_RHPORT0_MODE into generated header 2020-07-29 16:05:31 +07:00
hathach
d8fef207d2 remove obsolete CFG in tusb_config.h 2020-07-29 15:45:01 +07:00
Dan Halbert
65c22aa434 storage.erase_filesystem(): unmount and wait 1 second before resetting 2020-07-28 17:52:56 -04:00
Jeff Epler
9fd10322fe supervisor: rename some locals for clarity
It's perfectly OK for these variables with static linkage to have the
same name, but it's inconvenient for humans like me.
2020-07-20 08:45:31 -05:00
Jeff Epler
6160d11c5a supervisor: factor out, Handle USB via background callback 2020-07-15 11:49:44 -05:00
Sean Cross
d1a7fdd9d4 supervisor: support debugging tinyusb
Allow for passing `-DCFG_TUSB_DEBUG=1` or `-DCFG_TUSB_DEBUG=2` on the
command line to enable debugging tinyusb within circuitpython.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-21 21:35:30 +08:00
Scott Shawcroft
6aaab005c5
Initial ESP32S2 port.
Basic blinky works but doesn't check pins.
2020-05-15 15:36:16 -07:00
Scott Shawcroft
755d404edf
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-27 16:45:10 -07:00
Scott Shawcroft
dcb0e50f04
Fix USB midi and hid disable. 2020-04-21 14:15:44 -07:00
Scott Shawcroft
7e3d4c61b5
Update TinyUSB and add interrupt hooks. 2020-04-17 14:16:49 -07:00
Scott Shawcroft
6f60afe8c5
First try at lowering the power consumption 2020-03-13 11:12:30 -07:00
Scott Shawcroft
876c646d09
Fix Mac crash when waking up with an ejected CIRCUITPY
We now correctly set the reason for the unit not being ready and
always start the unit.

Fixes #2567
2020-02-24 15:40:52 -08:00
Gadi Rotenberg
07708f1518 Added fix to allow remount when usb enabled but msc is ejected 2020-02-12 09:57:58 +02:00
Scott Shawcroft
561fdfb279
Improve USB eject by resetting on replug 2019-12-17 19:01:03 -08:00
Dan Halbert
91d791afd0 cleanup adapter.address; add uniquish suffix to BLE device name 2019-07-31 00:30:24 -04:00
hathach
5d03cda01a whitespace 2019-07-24 16:49:13 +07:00
hathach
c921f6637f update tinyusb lib to 0.5.x 2019-07-24 16:46:31 +07:00
Scott Shawcroft
796fc3f5ab
Update font location and shrink a bunch of builds 2019-04-12 15:25:48 -07:00
hathach
9d43a25d6e update tinyusb to fix disconnect/suspend issue with #1681 2019-04-04 17:59:20 -04:00
Scott Shawcroft
1a0596a2fb
Add option to disable the concurrent write protection
This allows writing to the filesystem from the host computer and
CircuitPython by increasing the risk of filesystem corruption.
2019-02-21 10:45:41 -08:00