diff options
author | David Lamparter <equinox@diac24.net> | 2018-05-26 15:59:14 +0300 |
---|---|---|
committer | Karl Palsson <karlp@tweak.net.au> | 2018-08-27 18:11:32 +0300 |
commit | ebcf1978106322e92a7b1f53b58a33c6ff432cbd (patch) | |
tree | 50c852a29f862b24078ff182dfd09e01b46b639b /lib/usb/usb.c | |
parent | 343cff467513759e1fdaa28deff0879350ad9c44 (diff) |
usb: make usb_disconnect() weak
usb_disconnect() is board/platform specific for chips that don't have
built-in handling for this. Allow the application to provide its own
version of usb_disconnect() to handle this.
See https://github.com/libopencm3/libopencm3/pull/924
Diffstat (limited to 'lib/usb/usb.c')
-rw-r--r-- | lib/usb/usb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/usb/usb.c b/lib/usb/usb.c index cca6dde1..e2dd0c27 100644 --- a/lib/usb/usb.c +++ b/lib/usb/usb.c @@ -112,7 +112,8 @@ void usbd_poll(usbd_device *usbd_dev) usbd_dev->driver->poll(usbd_dev); } -void usbd_disconnect(usbd_device *usbd_dev, bool disconnected) +__attribute__((weak)) void usbd_disconnect(usbd_device *usbd_dev, + bool disconnected) { /* not all drivers support disconnection */ if (usbd_dev->driver->disconnect) { |