Skip to content

Generics #339

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

Closed
wants to merge 2 commits into from
Closed

Generics #339

wants to merge 2 commits into from

Conversation

burrbull
Copy link
Member

r? @therealprof
cc @adamgreig

I did it. Almost.

But still have problems with naming.

I want to name field enum as FIELD. But in some cases this cause troubles.

Now such system:

  • _R and _W for registers readers/writers (better R and W as it was before, but conflicts with field W)
  • FIELD for field enums/structs.
  • FIELD_R - field reader (was FIELDR before): now conflicts with CLK_EN_R field on Fujitsu and Spansion targets.
  • FIELD_W - field writer (was _FIELDW + FIELDW if have enumerated values)

@burrbull burrbull requested a review from a team as a code owner July 26, 2019 15:36
@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools labels Jul 26, 2019
@burrbull burrbull mentioned this pull request Jul 26, 2019
@burrbull burrbull closed this Jul 27, 2019
@therealprof
Copy link
Contributor

@burrbull You're too quick for me. Why did you close this? 😅

@burrbull
Copy link
Member Author

I found one bug in write proxy (tha. They shall not be derived (type FIELD_W<'a> = BASEFIELD_W<'a>) if base enum is out of register.
It should be new type FIELD_W<'a> = WProxy<'a, u32, REGNAME, bool, BASEFIELD, crate::Safe>.
Otherwise it will create incorrect register writers.

I thought I fix all main issues and create this common PR.
I can reopen #331 until find solution.

Also, there is a problem with names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants