Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

Commit

Permalink
Merge #1
Browse files Browse the repository at this point in the history
1: use less unstable features r=japaric a=japaric

depends on rust-embedded/cortex-m#88

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
  • Loading branch information
bors[bot] and japaric committed May 11, 2018
2 parents 356d5eb + bdbae5c commit a8818f8
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 9 deletions.
51 changes: 51 additions & 0 deletions .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
6 changes: 3 additions & 3 deletions Cargo.toml
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions bors.toml
@@ -0,0 +1,3 @@
status = [
"continuous-integration/travis-ci/push",
]
9 changes: 9 additions & 0 deletions 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
7 changes: 7 additions & 0 deletions ci/script.sh
@@ -0,0 +1,7 @@
set -euxo pipefail

main() {
cargo check --target $TARGET
}

main
8 changes: 2 additions & 6 deletions src/lib.rs
Expand Up @@ -29,16 +29,13 @@

#![deny(missing_docs)]
#![deny(warnings)]
#![feature(core_intrinsics)]
#![feature(lang_items)]
#![no_std]

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};
Expand All @@ -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 {}
}

0 comments on commit a8818f8

Please sign in to comment.