File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,18 @@ impl DWT {
144144 /// Returns the current clock cycle count
145145 #[ cfg( not( armv6m) ) ]
146146 #[ inline]
147+ #[ deprecated(
148+ since = "0.7.4" ,
149+ note = "Use `cycle_count` which follows the C-GETTER convention"
150+ ) ]
147151 pub fn get_cycle_count ( ) -> u32 {
152+ Self :: cycle_count ( )
153+ }
154+
155+ /// Returns the current clock cycle count
156+ #[ cfg( not( armv6m) ) ]
157+ #[ inline]
158+ pub fn cycle_count ( ) -> u32 {
148159 // NOTE(unsafe) atomic read with no side effects
149160 unsafe { ( * Self :: ptr ( ) ) . cyccnt . read ( ) }
150161 }
Original file line number Diff line number Diff line change 2323//! ```
2424//! A part of the peripheral API doesn't require access to a peripheral instance. This part of the
2525//! API is provided as static methods on the peripheral types. One example is the
26- //! [`DWT::get_cycle_count `](struct.DWT.html#method.get_cycle_count ) method.
26+ //! [`DWT::cycle_count `](struct.DWT.html#method.cycle_count ) method.
2727//!
2828//! ``` no_run
2929//! # use cortex_m::peripheral::{DWT, Peripherals};
3333//! } // all the peripheral singletons are destroyed here
3434//!
3535//! // but this method can be called without a DWT instance
36- //! let cyccnt = DWT::get_cycle_count ();
36+ //! let cyccnt = DWT::cycle_count ();
3737//! ```
3838//!
3939//! The singleton property can be *unsafely* bypassed using the `ptr` static method which is
You can’t perform that action at this time.
0 commit comments