File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ impl<const FREQ: u32> DwtProfiler<FREQ> {
9090 ///
9191 /// # Panics
9292 /// asserts that the compile time constant `FREQ` matches the runtime provided `sysclk`
93+ ///
94+ /// # Errors
95+ /// If the [`DWT`] doesn't have a cycle counter or configuration of it fails, we can return
96+ /// an error.
9397 pub fn new ( dcb : & mut DCB , mut dwt : DWT , sysclk : u32 ) -> Result < Self , DwtProfilerError > {
9498 assert ! ( FREQ == sysclk) ;
9599
@@ -116,7 +120,7 @@ impl<const FREQ: u32> DwtProfiler<FREQ> {
116120 emit : EmitOption :: WatchpointDebugEvent ,
117121 compare : 4_294_967_295 , // just before overflow (2**32 - 1)
118122 } ) )
119- . map_err ( |_conf_err| DwtProfilerError :: CycleCounterInvalidSettings ) ?
123+ . map_err ( |_conf_err| DwtProfilerError :: CycleCounterInvalidSettings ) ?;
120124 }
121125
122126 Ok ( Self { dwt } )
You can’t perform that action at this time.
0 commit comments