diff options
author | 2017-12-09 11:01:28 +0100 | |
---|---|---|
committer | 2017-12-09 11:01:28 +0100 | |
commit | b7a627cd986cb05e71c456782daaee4f47e26ede (patch) | |
tree | faa1f3886a13372227ccd838b455104daf94905a | |
parent | 9bab4175eb4120612e07470d060d6aca3b5edfd5 (diff) | |
download | cortex-m-b7a627cd986cb05e71c456782daaee4f47e26ede.tar.gz cortex-m-b7a627cd986cb05e71c456782daaee4f47e26ede.tar.zst cortex-m-b7a627cd986cb05e71c456782daaee4f47e26ede.zip |
fix tests
-rw-r--r-- | ci/install.sh | 2 | ||||
-rw-r--r-- | ci/script.sh | 2 | ||||
-rw-r--r-- | src/peripheral/mod.rs | 1 | ||||
-rw-r--r-- | src/peripheral/test.rs | 22 |
4 files changed, 14 insertions, 13 deletions
diff --git a/ci/install.sh b/ci/install.sh index f978160..b7d8195 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -1,4 +1,4 @@ -set -ex +set -euxo pipefail main() { case $TARGET in diff --git a/ci/script.sh b/ci/script.sh index 080e756..9b60f0c 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -1,4 +1,4 @@ -set -ex +set -euxo pipefail main() { case $TARGET in diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs index 7482398..a2c768e 100644 --- a/src/peripheral/mod.rs +++ b/src/peripheral/mod.rs @@ -69,6 +69,7 @@ static mut CORE_PERIPHERALS: bool = false; impl Peripherals { /// Returns all the core peripherals *once* + #[inline(always)] pub fn take() -> Option<Self> { interrupt::free(|_| { if unsafe { CORE_PERIPHERALS } { diff --git a/src/peripheral/test.rs b/src/peripheral/test.rs index 4cc488a..4283954 100644 --- a/src/peripheral/test.rs +++ b/src/peripheral/test.rs @@ -1,6 +1,6 @@ #[test] fn cpuid() { - let cpuid = unsafe { &*::peripheral::CPUID.get() }; + let cpuid = unsafe { &*::peripheral::CPUID::ptr() }; assert_eq!(address(&cpuid.base), 0xE000_ED00); assert_eq!(address(&cpuid.pfr), 0xE000_ED40); @@ -16,7 +16,7 @@ fn cpuid() { #[test] fn dcb() { - let dcb = unsafe { &*::peripheral::DCB.get() }; + let dcb = unsafe { &*::peripheral::DCB::ptr() }; assert_eq!(address(&dcb.dhcsr), 0xE000_EDF0); assert_eq!(address(&dcb.dcrsr), 0xE000_EDF4); @@ -26,7 +26,7 @@ fn dcb() { #[test] fn dwt() { - let dwt = unsafe { &*::peripheral::DWT.get() }; + let dwt = unsafe { &*::peripheral::DWT::ptr() }; assert_eq!(address(&dwt.ctrl), 0xE000_1000); assert_eq!(address(&dwt.cyccnt), 0xE000_1004); @@ -48,7 +48,7 @@ fn dwt() { #[test] fn fpb() { - let fpb = unsafe { &*::peripheral::FPB.get() }; + let fpb = unsafe { &*::peripheral::FPB::ptr() }; assert_eq!(address(&fpb.ctrl), 0xE000_2000); assert_eq!(address(&fpb.remap), 0xE000_2004); @@ -60,7 +60,7 @@ fn fpb() { #[test] fn fpu() { - let fpu = unsafe { &*::peripheral::FPU.get() }; + let fpu = unsafe { &*::peripheral::FPU::ptr() }; assert_eq!(address(&fpu.fpccr), 0xE000_EF34); assert_eq!(address(&fpu.fpcar), 0xE000_EF38); @@ -72,7 +72,7 @@ fn fpu() { #[test] fn itm() { - let itm = unsafe { &*::peripheral::ITM.get() }; + let itm = unsafe { &*::peripheral::ITM::ptr() }; assert_eq!(address(&itm.stim), 0xE000_0000); assert_eq!(address(&itm.ter), 0xE000_0E00); @@ -84,7 +84,7 @@ fn itm() { #[test] fn mpu() { - let mpu = unsafe { &*::peripheral::MPU.get() }; + let mpu = unsafe { &*::peripheral::MPU::ptr() }; assert_eq!(address(&mpu._type), 0xE000ED90); assert_eq!(address(&mpu.ctrl), 0xE000ED94); @@ -101,7 +101,7 @@ fn mpu() { #[test] fn nvic() { - let nvic = unsafe { &*::peripheral::NVIC.get() }; + let nvic = unsafe { &*::peripheral::NVIC::ptr() }; assert_eq!(address(&nvic.iser), 0xE000E100); assert_eq!(address(&nvic.iser[7]), 0xE000E11C); @@ -119,7 +119,7 @@ fn nvic() { #[test] fn scb() { - let scb = unsafe { &*::peripheral::SCB.get() }; + let scb = unsafe { &*::peripheral::SCB::ptr() }; assert_eq!(address(&scb.icsr), 0xE000_ED04); assert_eq!(address(&scb.vtor), 0xE000_ED08); @@ -140,7 +140,7 @@ fn scb() { #[test] fn syst() { - let syst = unsafe { &*::peripheral::SYST.get() }; + let syst = unsafe { &*::peripheral::SYST::ptr() }; assert_eq!(address(&syst.csr), 0xE000_E010); assert_eq!(address(&syst.rvr), 0xE000_E014); @@ -151,7 +151,7 @@ fn syst() { #[test] fn tpiu() { - let tpiu = unsafe { &*::peripheral::TPIU.get() }; + let tpiu = unsafe { &*::peripheral::TPIU::ptr() }; assert_eq!(address(&tpiu.sspsr), 0xE004_0000); assert_eq!(address(&tpiu.cspsr), 0xE004_0004); |