From bdbae5c437325d8bcc4834b9f9bf1c673d106d09 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 26 Apr 2018 07:16:53 +0200 Subject: [PATCH] use less unstable features --- .travis.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 6 +++--- bors.toml | 3 +++ ci/install.sh | 9 +++++++++ ci/script.sh | 7 +++++++ src/lib.rs | 8 ++------ 6 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 .travis.yml create mode 100644 bors.toml create mode 100644 ci/install.sh create mode 100644 ci/script.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..2a5be695 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,51 @@ +language: rust + +matrix: + include: + - env: TARGET=x86_64-unknown-linux-gnu + rust: nightly + + - env: TARGET=thumbv7m-none-eabi + rust: nightly + addons: + apt: + packages: + - gcc-arm-none-eabi + + - env: TARGET=thumbv7em-none-eabi + rust: nightly + addons: + apt: + packages: + - gcc-arm-none-eabi + + - env: TARGET=thumbv7em-none-eabihf + rust: nightly + addons: + apt: + packages: + - gcc-arm-none-eabi + +before_install: set -e + +install: + - bash ci/install.sh + +script: + - bash ci/script.sh + +after_script: set +e + +cache: cache + +before_cache: + - chmod -R a+r $HOME/.cargo; + +branches: + only: + - staging + - trying + +notifications: + email: + on_success: never diff --git a/Cargo.toml b/Cargo.toml index 4b2c1707..7fe5b800 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,8 @@ keywords = ["panic-impl", "panic", "ITM", "ARM", "Cortex-M"] license = "MIT OR Apache-2.0" name = "panic-itm" repository = "https://github.com/japaric/panic-itm" -version = "0.1.0" +version = "0.1.1" [dependencies] -cortex-m = "0.4.3" -aligned = "0.1.1" +aligned = "0.2.0" +cortex-m = "0.5.0" diff --git a/bors.toml b/bors.toml new file mode 100644 index 00000000..5ccee21e --- /dev/null +++ b/bors.toml @@ -0,0 +1,3 @@ +status = [ + "continuous-integration/travis-ci/push", +] \ No newline at end of file diff --git a/ci/install.sh b/ci/install.sh new file mode 100644 index 00000000..3c419211 --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,9 @@ +set -euxo pipefail + +main() { + if [ $TARGET != x86_64-unknown-linux-gnu ]; then + rustup target add $TARGET + fi +} + +main diff --git a/ci/script.sh b/ci/script.sh new file mode 100644 index 00000000..9e10e88e --- /dev/null +++ b/ci/script.sh @@ -0,0 +1,7 @@ +set -euxo pipefail + +main() { + cargo check --target $TARGET +} + +main diff --git a/src/lib.rs b/src/lib.rs index db9f9489..fce5a744 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,7 +29,6 @@ #![deny(missing_docs)] #![deny(warnings)] -#![feature(core_intrinsics)] #![feature(lang_items)] #![no_std] @@ -37,8 +36,6 @@ extern crate aligned; #[macro_use] extern crate cortex_m; -use core::intrinsics; - use aligned::Aligned; use cortex_m::peripheral::ITM; use cortex_m::{interrupt, itm}; @@ -57,10 +54,9 @@ unsafe extern "C" fn panic_fmt( itm::write_aligned(stim, &Aligned(*b"panicked at '")); itm::write_fmt(stim, args); - itm::write_str(stim, "', "); + itm::write_aligned(stim, &Aligned(*b"', ")); itm::write_str(stim, file); iprintln!(stim, ":{}:{}", line, col); - // XXX What should be the behavior after logging the message? - intrinsics::abort() + loop {} }