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

dcd_da146xx: Remove registers pointer from xfer_ctl_t #1103

Merged
merged 2 commits into from
Sep 24, 2021

Conversation

kasjer
Copy link
Collaborator

@kasjer kasjer commented Sep 24, 2021

Describe the PR

xfer_ctl_t structure keeps all dynamic data connected with transfer.
It used to have pointer to register set that was constant and was there
for convenience only.
Removing register pointer from structure makes cleanup easier as whole
structure can be erased with memset-like function.

In many cases functions were using local variable regs and xfer->regs which
were same, that could be confusing so this part is unified.

Few macros were added for easy conversion between epnum, xfer, and regs.

dcd_edpt_close() now clears xfer and can be used in dcd_edpt_close_all()
with expected behavior.

Apart from the above PR does not change any logic in driver.

Additional context
Endpoint close updated to much what #1096 expects.

Note: this commit does not change any logic.

xfer_ctl_t structure keeps all dynamic data connected with transfer.
It used to have pointer to register set that was constant and was there
for convenience only.
Removing register pointer from structure makes cleanup easier as whole
structure can be erased with memset like function.

In many cases functions were using local variable regs and xfer->regs which
were same, that could be confusing so this part is unified.

Few macros were added for easy conversion between epnum, xfer, and regs.
Closing endpoint clears data in affected xfer_ctl_t
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.

look great, thank you

@hathach hathach merged commit 1c17cb1 into hathach:master Sep 24, 2021
@kasjer kasjer deleted the kasjer/da146xx-close-cleanup branch September 24, 2021 14:08
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.

2 participants