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

DWT: differentiate the first comparator #376

Open
tmplt opened this issue Jan 1, 2022 · 4 comments · May be fixed by #377
Open

DWT: differentiate the first comparator #376

tmplt opened this issue Jan 1, 2022 · 4 comments · May be fixed by #377

Comments

@tmplt
Copy link
Contributor

tmplt commented Jan 1, 2022

As discussed in #364 we should ideally check whether a DWT feature is supported statically. This is only realistically applicable for cycle count comparisons (but still requires a runtime check) which is only supported on the first comparator. An implementation would then have some DWTComparatorFirst and DWTComparator structures that implement a common trait: if cycle count comparison is configured for DWTComparator, an error is returned.

Opening this issue for discussion purposes for now. At present the documentation warns that cycle count comparison is only available with the first comparator.

@tmplt
Copy link
Contributor Author

tmplt commented Jan 1, 2022

CC @TDHolmes

@TDHolmes
Copy link
Contributor

TDHolmes commented Jan 1, 2022 via email

@TDHolmes
Copy link
Contributor

TDHolmes commented Jan 1, 2022

🏷️ #367 (the cycle count PR)

TDHolmes added a commit to TDHolmes/cortex-m that referenced this issue Jan 2, 2022
Statically enforces that only comparator 0 on `armv7m` can be configured
for cycle comparison by introducing a marker trait differentiating
comparator 0 and the rest of them, and only implementing the ability for
this configuration on comparator 0.

Closes rust-embedded#376
TDHolmes added a commit to TDHolmes/cortex-m that referenced this issue Jan 2, 2022
Statically enforces that only comparator 0 on `armv7m` can be configured
for cycle comparison by introducing a marker trait differentiating
comparator 0 and the rest of them, and only implementing the ability for
this configuration on comparator 0.

Closes rust-embedded#376
@TDHolmes
Copy link
Contributor

TDHolmes commented Jan 2, 2022

I was wrong, only comparator zero is special. Opened up a PR

TDHolmes added a commit to TDHolmes/cortex-m that referenced this issue Jan 6, 2022
Statically enforces that only comparator 0 on `armv7m` can be configured
for cycle comparison by introducing a marker trait differentiating
comparator 0 and the rest of them, and only implementing the ability for
this configuration on comparator 0.

Closes rust-embedded#376
TDHolmes added a commit to TDHolmes/cortex-m that referenced this issue Oct 8, 2022
Statically enforces that only comparator 0 on `armv7m` can be configured
for cycle comparison by introducing a marker trait differentiating
comparator 0 and the rest of them, and only implementing the ability for
this configuration on comparator 0.

Closes rust-embedded#376
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 a pull request may close this issue.

2 participants