diff options
author | 2022-08-11 01:49:33 +0200 | |
---|---|---|
committer | 2022-08-11 23:31:08 +0200 | |
commit | 3a15a6b4b320fa328e8ab99c31f81536960dd280 (patch) | |
tree | 4c3ef55e91988845873479460e438afea445c919 /src/peripheral/sau.rs | |
parent | 4e908625204a1e95dd3fd5bdcd8d66d6bc11c3bc (diff) | |
download | cortex-m-3a15a6b4b320fa328e8ab99c31f81536960dd280.tar.gz cortex-m-3a15a6b4b320fa328e8ab99c31f81536960dd280.tar.zst cortex-m-3a15a6b4b320fa328e8ab99c31f81536960dd280.zip |
Add implementation for critical-section 1.0
Co-Authored-By: Markus Reiter <me@reitermark.us>
Diffstat (limited to 'src/peripheral/sau.rs')
-rw-r--r-- | src/peripheral/sau.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/peripheral/sau.rs b/src/peripheral/sau.rs index da91aca..6b8477f 100644 --- a/src/peripheral/sau.rs +++ b/src/peripheral/sau.rs @@ -7,7 +7,6 @@ //! //! For reference please check the section B8.3 of the Armv8-M Architecture Reference Manual. -use crate::interrupt; use crate::peripheral::SAU; use bitfield::bitfield; use volatile_register::{RO, RW}; @@ -162,7 +161,7 @@ impl SAU { /// This function is executed under a critical section to prevent having inconsistent results. #[inline] pub fn set_region(&mut self, region_number: u8, region: SauRegion) -> Result<(), SauError> { - interrupt::free(|_| { + critical_section::with(|_| { let base_address = region.base_address; let limit_address = region.limit_address; let attribute = region.attribute; @@ -215,7 +214,7 @@ impl SAU { /// This function is executed under a critical section to prevent having inconsistent results. #[inline] pub fn get_region(&mut self, region_number: u8) -> Result<SauRegion, SauError> { - interrupt::free(|_| { + critical_section::with(|_| { if region_number >= self.region_numbers() { Err(SauError::RegionNumberTooBig) } else { |