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

Improved HFCLK management for nRF5x #2070

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Matt-prog
Copy link

Improved HFCLK management for nRF5x with weak functions, the user can override and implement it's own HFCLK management, when other peripherials, such as Radio needs it.

Usage
User can override those functions:
void dcd_enable_hfclk(void); - called, when dcd requests HFCLK activation
void dcd_disable_hfclk(void); - called, when dcd requests HFCLK deactivation

If the functions are not overridden, HFCLK will be activated and deactivated by TinyUSB.

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

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

  1. Adding new .c and .h are not accepted, please put them all under current dcd file. dcd_* callback name also need changes as well (but that can wait for later).
  2. For this minor changes, please remove your name from the copy right list as well as CONTRIBUTORs.rst. Instead put an comment note at the end of the license term with for your name and the changes.

@Matt-prog
Copy link
Author

Hi @hathach,
thank you for the review! I am currently implementing the suggested changes. I moved the contents of the file dcd_nrf5x_cb.c to dcd_nrf5x.c. However, I would keep the header file (or rename it to dcd_nrf5x.h). This file can be included in the user .c or .cpp file with the definition of the "strong" functions. For the example, see here how I implemented it in the library, which controls Radio and HFCLK instead of SoftDevice on nRF52 board.

Do you have any suggestions for callback function names? Does the dcd_ or another prefix should be used?

I have removed my name from the copyright list and the CONTRIBUTORS.rst file. Sorry for the misunderstanding, this is my first pull request on github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants