aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonathan 'theJPster' Pallant <github@thejpster.org.uk> 2019-03-16 22:46:18 +0000
committerGravatar Jonathan 'theJPster' Pallant <github@thejpster.org.uk> 2019-03-16 22:46:18 +0000
commitbb25ff4507f72859b4b6f09a0b81632873053abf (patch)
treee291c56b97880f03650be7c097c06a7ca6ec1b0e
parent4a0e534b805bbf45e1c014e73fe9ee3103005705 (diff)
downloadcortex-m-bb25ff4507f72859b4b6f09a0b81632873053abf.tar.gz
cortex-m-bb25ff4507f72859b4b6f09a0b81632873053abf.tar.zst
cortex-m-bb25ff4507f72859b4b6f09a0b81632873053abf.zip
Bump cortex-m dev-dep to 0.6 (it's only a dev-dep and so doesn't affect other packages)
Disable the semihosting test on thumbv8, as it's currently unsupported in cortex-m-semihosting
-rw-r--r--cortex-m-rt/Cargo.toml15
-rw-r--r--cortex-m-rt/examples/qemu.rs19
2 files changed, 28 insertions, 6 deletions
diff --git a/cortex-m-rt/Cargo.toml b/cortex-m-rt/Cargo.toml
index 949bdad..29310d7 100644
--- a/cortex-m-rt/Cargo.toml
+++ b/cortex-m-rt/Cargo.toml
@@ -19,10 +19,21 @@ autoexamples = true
r0 = "0.2.2"
cortex-m-rt-macros = { path = "macros", version = "0.1.5" }
+[target.thumbv7em-none-eabihf.dev-dependencies]
+cortex-m-semihosting = "0.3.1"
+
+[target.thumbv7em-none-eabi.dev-dependencies]
+cortex-m-semihosting = "0.3.1"
+
+[target.thumbv7m-none-eabi.dev-dependencies]
+cortex-m-semihosting = "0.3.1"
+
+[target.thumbv6m-none-eabi.dev-dependencies]
+cortex-m-semihosting = "0.3.1"
+
[dev-dependencies]
-cortex-m = ">= 0.5.7, <0.7"
+cortex-m = "0.6"
panic-halt = "0.2.0"
-cortex-m-semihosting = "0.3.1"
[dev-dependencies.rand]
default-features = false
diff --git a/cortex-m-rt/examples/qemu.rs b/cortex-m-rt/examples/qemu.rs
index e2cd895..7553e70 100644
--- a/cortex-m-rt/examples/qemu.rs
+++ b/cortex-m-rt/examples/qemu.rs
@@ -2,18 +2,22 @@
#![no_main]
#![no_std]
-extern crate cortex_m;
+extern crate cortex_m;
extern crate cortex_m_rt as rt;
+
+#[cfg(not(armv8m))]
extern crate cortex_m_semihosting as semihosting;
+
extern crate panic_halt;
-use core::fmt::Write;
use cortex_m::asm;
use rt::entry;
+#[cfg(not(armv8m))]
#[entry]
fn main() -> ! {
+ use core::fmt::Write;
let x = 42;
loop {
@@ -21,9 +25,16 @@ fn main() -> ! {
// write something through semihosting interface
let mut hstdout = semihosting::hio::hstdout().unwrap();
- write!(hstdout, "x = {}\n", x);
-
+ write!(hstdout, "x = {}\n", x).unwrap();
// exit from qemu
semihosting::debug::exit(semihosting::debug::EXIT_SUCCESS);
}
}
+
+#[cfg(armv8m)]
+#[entry]
+fn main() -> ! {
+ loop {
+ asm::nop();
+ }
+}