aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2017-07-20 23:03:45 -0500
committerGravatar Jorge Aparicio <jorge@japaric.io> 2017-07-20 23:03:45 -0500
commit0788a15a39599dece96ba5d2f8cb15c7e397939a (patch)
tree26cc2687685b51d66275305699b0f06d82579179
parentc7b9507a57f2ba28c18b15dd2719a1c56f74a302 (diff)
downloadrtic-0788a15a39599dece96ba5d2f8cb15c7e397939a.tar.gz
rtic-0788a15a39599dece96ba5d2f8cb15c7e397939a.tar.zst
rtic-0788a15a39599dece96ba5d2f8cb15c7e397939a.zip
update CI
-rw-r--r--.cargo/config24
-rw-r--r--.travis.yml4
-rw-r--r--ci/install.sh29
-rw-r--r--ci/script.sh9
-rw-r--r--examples/nested.rs7
-rw-r--r--src/examples/_4_nested.rs7
6 files changed, 49 insertions, 31 deletions
diff --git a/.cargo/config b/.cargo/config
index 1642997e..4db47406 100644
--- a/.cargo/config
+++ b/.cargo/config
@@ -1,3 +1,11 @@
+[target.thumbv6m-none-eabi]
+runner = 'arm-none-eabi-gdb'
+rustflags = [
+ "-C", "link-arg=-Tlink.x",
+ "-C", "linker=arm-none-eabi-ld",
+ "-Z", "linker-flavor=ld",
+]
+
[target.thumbv7m-none-eabi]
runner = 'arm-none-eabi-gdb'
rustflags = [
@@ -5,3 +13,19 @@ rustflags = [
"-C", "linker=arm-none-eabi-ld",
"-Z", "linker-flavor=ld",
]
+
+[target.thumbv7em-none-eabi]
+runner = 'arm-none-eabi-gdb'
+rustflags = [
+ "-C", "link-arg=-Tlink.x",
+ "-C", "linker=arm-none-eabi-ld",
+ "-Z", "linker-flavor=ld",
+]
+
+[target.thumbv7em-none-eabihf]
+runner = 'arm-none-eabi-gdb'
+rustflags = [
+ "-C", "link-arg=-Tlink.x",
+ "-C", "linker=arm-none-eabi-ld",
+ "-Z", "linker-flavor=ld",
+] \ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index d0860bc7..0fdf5a8b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,4 @@
-dist: trusty
language: rust
-services: docker
-sudo: required
matrix:
include:
@@ -20,7 +17,6 @@ before_install: set -e
install:
- sh ci/install.sh
- - source ~/.cargo/env || true
script:
- bash ci/script.sh
diff --git a/ci/install.sh b/ci/install.sh
index 748ad9a9..6e7fcc28 100644
--- a/ci/install.sh
+++ b/ci/install.sh
@@ -1,27 +1,14 @@
set -ex
main() {
- local target=
- if [ $TRAVIS_OS_NAME = linux ]; then
- target=x86_64-unknown-linux-musl
- sort=sort
- else
- target=x86_64-apple-darwin
- sort=gsort # for `sort --sort-version`, from brew's coreutils.
- fi
-
- # This fetches latest stable release
- local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
- | cut -d/ -f3 \
- | grep -E '^v[0.1.0-9.]+$' \
- | $sort --version-sort \
- | tail -n1)
- curl -LSfs https://japaric.github.io/trust/install.sh | \
- sh -s -- \
- --force \
- --git japaric/cross \
- --tag $tag \
- --target $target
+ case $TARGET in
+ thumbv*-none-eabi*)
+ cargo install --list | grep xargo || \
+ cargo install xargo
+ rustup component list | grep 'rust-src.*installed' || \
+ rustup component add rust-src
+ ;;
+ esac
}
main
diff --git a/ci/script.sh b/ci/script.sh
index 9f83f3f4..212a48ad 100644
--- a/ci/script.sh
+++ b/ci/script.sh
@@ -2,12 +2,17 @@ set -ex
main() {
if [ $TARGET = x86_64-unknown-linux-gnu ]; then
+ cargo build
cargo test
return
fi
- cross build --target $TARGET
- cross build --target $TARGET --release
+ xargo build --target $TARGET
+ for ex in $(ls examples/*); do
+ ex=$(basename $ex)
+ ex=${ex%.*}
+ xargo build --target $TARGET --example $ex
+ done
}
main
diff --git a/examples/nested.rs b/examples/nested.rs
index d307634c..fda2a7d4 100644
--- a/examples/nested.rs
+++ b/examples/nested.rs
@@ -63,6 +63,9 @@ task!(EXTI0, exti0);
fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
// because this task has a priority of 1 the preemption threshold is also 1
+ let mut low = r.LOW;
+ let mut high = r.HIGH;
+
// A
rtfm::bkpt();
@@ -70,7 +73,7 @@ fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
rtfm::set_pending(Interrupt::EXTI1); // ~> exti1
// a claim creates a critical section
- r.LOW.claim_mut(t, |_low, t| {
+ low.claim_mut(t, |_low, t| {
// this claim increases the preemption threshold to 2
// just high enough to not race with task `exti1` for access to the
// `LOW` resource
@@ -90,7 +93,7 @@ fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
rtfm::bkpt();
// claims can be nested
- r.HIGH.claim_mut(t, |_high, _| {
+ high.claim_mut(t, |_high, _| {
// This claim increases the preemption threshold to 3
// now `exti2` can't preempt this task
diff --git a/src/examples/_4_nested.rs b/src/examples/_4_nested.rs
index 718710d7..6be68d8e 100644
--- a/src/examples/_4_nested.rs
+++ b/src/examples/_4_nested.rs
@@ -65,6 +65,9 @@
//! fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
//! // because this task has a priority of 1 the preemption threshold is also 1
//!
+//! let mut low = r.LOW;
+//! let mut high = r.HIGH;
+//!
//! // A
//! rtfm::bkpt();
//!
@@ -72,7 +75,7 @@
//! rtfm::set_pending(Interrupt::EXTI1); // ~> exti1
//!
//! // a claim creates a critical section
-//! r.LOW.claim_mut(t, |_low, t| {
+//! low.claim_mut(t, |_low, t| {
//! // this claim increases the preemption threshold to 2
//! // just high enough to not race with task `exti1` for access to the
//! // `LOW` resource
@@ -92,7 +95,7 @@
//! rtfm::bkpt();
//!
//! // claims can be nested
-//! r.HIGH.claim_mut(t, |_high, _| {
+//! high.claim_mut(t, |_high, _| {
//! // This claim increases the preemption threshold to 3
//!
//! // now `exti2` can't preempt this task