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

make inline assembly opt-in #2

Merged
merged 2 commits into from
May 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
language: rust

matrix:
include:
- env: TARGET=x86_64-unknown-linux-gnu
rust: nightly

- env: TARGET=thumbv6m-none-eabi
rust: nightly
addons:
apt:
packages:
- gcc-arm-none-eabi

- 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
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [v0.2.0] - 2018-05-11

### Changed

- [breaking-change] made inline assembly (`asm!`) opt-in via the `"inline-asm"` feature. This is a
breaking change because this crate now requires `arm-none-eabi-gcc` to be installed to build
without the `"inline-asm"` feature, which is the default.

## v0.1.0 - 2018-04-09

Initial release

[Unreleased]: https://github.com/japaric/panic-semihosting/compare/v0.1.0...HEAD
[Unreleased]: https://github.com/japaric/panic-semihosting/compare/v0.2.0...HEAD
[v0.2.0]: https://github.com/japaric/panic-semihosting/compare/v0.1.0...v0.2.0
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ keywords = ["panic-impl", "panic", "semihosting"]
license = "MIT OR Apache-2.0"
name = "panic-semihosting"
repository = "https://github.com/japaric/panic-semihosting"
version = "0.1.0"
version = "0.2.0"

[dependencies]
cortex-m-semihosting = "0.2.0"
cortex-m = "0.4.3"
cortex-m = "0.5.0"
cortex-m-semihosting= "0.3.0"

[features]
inline-asm = ["cortex-m-semihosting/inline-asm", "cortex-m/inline-asm"]
3 changes: 3 additions & 0 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
status = [
"continuous-integration/travis-ci/push",
]
9 changes: 9 additions & 0 deletions ci/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set -euxo pipefail

main() {
if [ $TARGET != x86_64-unknown-linux-gnu ]; then
rustup target add $TARGET
fi
}

main
11 changes: 11 additions & 0 deletions ci/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set -euxo pipefail

main() {
cargo check --target $TARGET

if [ $TRAVIS_RUST_VERSION = nightly ]; then
cargo check --target $TARGET --features inline-asm
fi
}

main
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
//!
//! [`cortex-m-semihosting`]: https://crates.io/crates/cortex-m-semihosting
//!
//! # Requirements
//!
//! To build this crate on the stable or beta channels `arm-none-eabi-gcc` needs to be installed and
//! available in `$PATH`.
//!
//! # Usage
//!
//! ``` ignore
Expand All @@ -32,6 +37,19 @@
//! (..)
//! panicked at 'FOO', src/main.rs:6:5
//! ```
//!
//! # Optional features
//!
//! ## `inline-asm`
//!
//! When this feature is enabled semihosting is implemented using inline assembly (`asm!`) and
//! compiling this crate requires nightly.
//!
//! When this feature is disabled semihosting is implemented using FFI calls into an external
//! assembly file and compiling this crate works on stable and beta.
//!
//! Apart from the toolchain requirement, enabling `inline-asm` removes the requirement of having
//! `arm-none-eabi-gcc` installed on the host.

#![deny(missing_docs)]
#![deny(warnings)]
Expand Down