File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
21
21
- Moved ` info::uid64_devnum ` to ` info::Uid64::read_devnum ` .
22
22
- Moved ` info::package ` to ` info::Package::from_device ` .
23
23
- Moved ` info::uid ` to ` info::Uid::from_device ` .
24
+ - Added ` #[inline] ` to ` util::new_delay ` and ` util::reset_cycle_count ` .
24
25
25
26
## [ 0.2.1] - 2021-11-20
26
27
### Fixed
Original file line number Diff line number Diff line change 1
1
//! Miscellaneous utilities
2
2
use crate :: pac;
3
- use core:: ptr:: write_volatile;
4
3
use cortex_m:: { delay:: Delay , peripheral:: syst:: SystClkSource } ;
5
4
6
5
/// Create a new [`cortex_m::delay::Delay`] from the current CPU systick
@@ -15,6 +14,7 @@ use cortex_m::{delay::Delay, peripheral::syst::SystClkSource};
15
14
/// let cp = pac::CorePeripherals::take().unwrap();
16
15
/// let delay = new_delay(cp.SYST, &dp.RCC);
17
16
/// ```
17
+ #[ inline]
18
18
pub fn new_delay ( syst : pac:: SYST , rcc : & pac:: RCC ) -> Delay {
19
19
Delay :: new (
20
20
syst,
@@ -41,7 +41,8 @@ pub fn new_delay(syst: pac::SYST, rcc: &pac::RCC) -> Delay {
41
41
///
42
42
/// [#347]: https://github.com/rust-embedded/cortex-m/pull/347
43
43
#[ allow( unused_variables) ]
44
+ #[ inline]
44
45
pub fn reset_cycle_count ( dwt : & mut pac:: DWT ) {
45
- const DWT_CYCCNT : usize = 0xE0001004 ;
46
- unsafe { write_volatile ( DWT_CYCCNT as * mut u32 , 0 ) } ;
46
+ const DWT_CYCCNT : * mut u32 = 0xE0001004 as * mut u32 ;
47
+ unsafe { DWT_CYCCNT . write_volatile ( 0 ) } ;
47
48
}
You can’t perform that action at this time.
0 commit comments