Skip to content

dcd_da146xx: Remove registers pointer from xfer_ctl_t#1103

Merged
hathach merged 2 commits into
hathach:masterfrom
kasjer:kasjer/da146xx-close-cleanup
Sep 24, 2021
Merged

dcd_da146xx: Remove registers pointer from xfer_ctl_t#1103
hathach merged 2 commits into
hathach:masterfrom
kasjer:kasjer/da146xx-close-cleanup

Conversation

@kasjer
Copy link
Copy Markdown
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
Copy Markdown
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