@@ -389,9 +389,10 @@ pub struct CycleCountSettings {
389
389
pub enum ComparatorFunction {
390
390
/// Compare accessed memory addresses.
391
391
Address ( ComparatorAddressSettings ) ,
392
- /// Compare cycle count & target value.
392
+ /// Compare cycle count & target value.
393
393
///
394
- /// **NOTE**: only supported by comparator 0. See C1.8.1.
394
+ /// **NOTE**: only supported by comparator 0 and if the HW supports the cycle counter.
395
+ /// Check `dwt.has_cycle_counter` for support. See C1.8.1 for more details.
395
396
CycleCount ( CycleCountSettings ) ,
396
397
}
397
398
@@ -408,7 +409,7 @@ pub enum DwtError {
408
409
impl Comparator {
409
410
/// Configure the function of the comparator
410
411
#[ allow( clippy:: missing_inline_in_public_items) ]
411
- pub fn configure ( & self , dwt : & DWT , settings : ComparatorFunction ) -> Result < ( ) , DwtError > {
412
+ pub fn configure ( & self , settings : ComparatorFunction ) -> Result < ( ) , DwtError > {
412
413
match settings {
413
414
ComparatorFunction :: Address ( settings) => {
414
415
// FUNCTION, EMITRANGE
@@ -461,10 +462,6 @@ impl Comparator {
461
462
}
462
463
}
463
464
ComparatorFunction :: CycleCount ( settings) => {
464
- if !dwt. has_cycle_counter ( ) {
465
- return Err ( DwtError :: NoCycleCount ) ;
466
- }
467
-
468
465
let function = match & settings. emit {
469
466
EmitOption :: PCData => 0b0001 ,
470
467
EmitOption :: WatchpointDebugEvent => 0b0100 ,
0 commit comments