Skip to content
Snippets Groups Projects
Commit b7a627cd authored by Jorge Aparicio's avatar Jorge Aparicio
Browse files

fix tests

parent 9bab4175
No related branches found
No related tags found
No related merge requests found
set -ex
set -euxo pipefail
main() {
case $TARGET in
......
set -ex
set -euxo pipefail
main() {
case $TARGET in
......
......@@ -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 } {
......
#[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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment