File tree 2 files changed +13
-2
lines changed 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,18 @@ impl DWT {
144
144
/// Returns the current clock cycle count
145
145
#[ cfg( not( armv6m) ) ]
146
146
#[ inline]
147
+ #[ deprecated(
148
+ since = "0.7.4" ,
149
+ note = "Use `cycle_count` which follows the C-GETTER convention"
150
+ ) ]
147
151
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 {
148
159
// NOTE(unsafe) atomic read with no side effects
149
160
unsafe { ( * Self :: ptr ( ) ) . cyccnt . read ( ) }
150
161
}
Original file line number Diff line number Diff line change 23
23
//! ```
24
24
//! A part of the peripheral API doesn't require access to a peripheral instance. This part of the
25
25
//! 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.
27
27
//!
28
28
//! ``` no_run
29
29
//! # use cortex_m::peripheral::{DWT, Peripherals};
33
33
//! } // all the peripheral singletons are destroyed here
34
34
//!
35
35
//! // but this method can be called without a DWT instance
36
- //! let cyccnt = DWT::get_cycle_count ();
36
+ //! let cyccnt = DWT::cycle_count ();
37
37
//! ```
38
38
//!
39
39
//! 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