diff options
Diffstat (limited to 'cortex-m/src/peripheral')
-rw-r--r-- | cortex-m/src/peripheral/scb.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/cortex-m/src/peripheral/scb.rs b/cortex-m/src/peripheral/scb.rs index b9cf0e4..b10f9d2 100644 --- a/cortex-m/src/peripheral/scb.rs +++ b/cortex-m/src/peripheral/scb.rs @@ -664,10 +664,7 @@ impl SCB { /// a runtime-dependent `panic!()` call. #[inline] pub unsafe fn invalidate_dcache_by_slice<T>(&mut self, slice: &mut [T]) { - self.invalidate_dcache_by_address( - slice.as_ptr() as usize, - slice.len() * core::mem::size_of::<T>(), - ); + self.invalidate_dcache_by_address(slice.as_ptr() as usize, core::mem::size_of_val(slice)); } /// Cleans D-cache by address. @@ -750,10 +747,7 @@ impl SCB { /// to main memory, overwriting whatever was in main memory. #[inline] pub fn clean_dcache_by_slice<T>(&mut self, slice: &[T]) { - self.clean_dcache_by_address( - slice.as_ptr() as usize, - slice.len() * core::mem::size_of::<T>(), - ); + self.clean_dcache_by_address(slice.as_ptr() as usize, core::mem::size_of_val(slice)); } /// Cleans and invalidates D-cache by address. |