Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor USB improvements #924

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

eqvinox
Copy link
Contributor

@eqvinox eqvinox commented May 26, 2018

(see individual commits)

This allows the pointer table to be in Flash, by using
"static const char * const strings[] = { ... };"
Extend usbd_init() docs & describe NAK/read_packet pitfalls.
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.
* @li @link stm32f207_usb_driver @endlink
* @li @link st_usbfs_v2_usb_driver @endlink
* @li @link efm32lg_usb_driver @endlink
* @li @link efm32hg_usb_driver @endlink
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oooh nice doxygen. is there anyway to j ust link to a type name? we can then make the drivers be members of that instead. ie, the efm32 driver is already refactored in my local tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, I wrote this with googling and the Doxygen manual open on the side ;)

@karlp
Copy link
Member

karlp commented May 26, 2018

Can you not just put your desired disconnect function into the driver struct?

@eqvinox
Copy link
Contributor Author

eqvinox commented May 26, 2018

Modifying the driver struct is kindof impossible:

  • the struct itself is const (rightfully so, as it should be in flash)
  • the driver functions are static (for some drivers, anyway) and thus can't be externally referenced (and that'd be ugly too)
  • creating a modified copy of the driver struct could therefore only happen at runtime and waste precious RAM

I've thought about it quite a bit and really think a weak usbd_disconnect is the best way to go.

@karlp
Copy link
Member

karlp commented Aug 21, 2018

I've pulled these locally, they all look good.

@karlp karlp self-assigned this Aug 21, 2018
karlp pushed a commit to karlp/libopencm3 that referenced this pull request Aug 25, 2018
This allows the pointer table to be in Flash, by using
"static const char * const strings[] = { ... };"

See libopencm3#924
karlp pushed a commit to karlp/libopencm3 that referenced this pull request Aug 25, 2018
Extend usbd_init() docs & describe NAK/read_packet pitfalls.

See libopencm3#924
karlp pushed a commit to karlp/libopencm3 that referenced this pull request Aug 25, 2018
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 libopencm3#924
karlp pushed a commit that referenced this pull request Aug 27, 2018
This allows the pointer table to be in Flash, by using
"static const char * const strings[] = { ... };"

See #924
karlp pushed a commit that referenced this pull request Aug 27, 2018
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 #924
karlp pushed a commit to karlp/libopencm3 that referenced this pull request Aug 27, 2018
Extend usbd_init() docs & describe NAK/read_packet pitfalls.

See libopencm3#924

REVIEW: check whether the docs are correct, and make sure that TI driver
is added
karlp pushed a commit to karlp/libopencm3 that referenced this pull request Aug 28, 2018
Extend usbd_init() docs & describe NAK/read_packet pitfalls.

See libopencm3#924

REVIEW: check whether the docs are correct, and make sure that TI driver
is added
grevaillot pushed a commit to grevaillot/libopencm3 that referenced this pull request Jan 11, 2019
This allows the pointer table to be in Flash, by using
"static const char * const strings[] = { ... };"

See libopencm3#924
grevaillot pushed a commit to grevaillot/libopencm3 that referenced this pull request Jan 11, 2019
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 libopencm3#924
BOJIT pushed a commit to BOJIT/PlatformIO-libopencm3 that referenced this pull request Jan 30, 2021
This allows the pointer table to be in Flash, by using
"static const char * const strings[] = { ... };"

See libopencm3#924
BOJIT pushed a commit to BOJIT/PlatformIO-libopencm3 that referenced this pull request Jan 30, 2021
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 libopencm3#924
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants