cortex-m
cortex-m copied to clipboard
DWT: differentiate the first comparator
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.
CC @TDHolmes
Thanks for opening this so we don’t forget. IIRC, the second comparator is also special (specific for data compare? I don’t recall the exact details)
On Sat, Jan 1, 2022 at 8:46 AM Viktor Vilhelm Sonesten < @.***> wrote:
CC @TDHolmes https://github.com/TDHolmes
— Reply to this email directly, view it on GitHub https://github.com/rust-embedded/cortex-m/issues/376#issuecomment-1003582983, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5YNWUPYTGJMY6EYWLFNYLUT4VWZANCNFSM5LCUWPVA . You are receiving this because you were mentioned.Message ID: @.***>
🏷️ #367 (the cycle count PR)
I was wrong, only comparator zero is special. Opened up a PR