mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
update CI
This commit is contained in:
parent
c7b9507a57
commit
0788a15a39
6 changed files with 49 additions and 31 deletions
|
@ -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]
|
[target.thumbv7m-none-eabi]
|
||||||
runner = 'arm-none-eabi-gdb'
|
runner = 'arm-none-eabi-gdb'
|
||||||
rustflags = [
|
rustflags = [
|
||||||
|
@ -5,3 +13,19 @@ rustflags = [
|
||||||
"-C", "linker=arm-none-eabi-ld",
|
"-C", "linker=arm-none-eabi-ld",
|
||||||
"-Z", "linker-flavor=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",
|
||||||
|
]
|
|
@ -1,7 +1,4 @@
|
||||||
dist: trusty
|
|
||||||
language: rust
|
language: rust
|
||||||
services: docker
|
|
||||||
sudo: required
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -20,7 +17,6 @@ before_install: set -e
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- sh ci/install.sh
|
- sh ci/install.sh
|
||||||
- source ~/.cargo/env || true
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- bash ci/script.sh
|
- bash ci/script.sh
|
||||||
|
|
|
@ -1,27 +1,14 @@
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local target=
|
case $TARGET in
|
||||||
if [ $TRAVIS_OS_NAME = linux ]; then
|
thumbv*-none-eabi*)
|
||||||
target=x86_64-unknown-linux-musl
|
cargo install --list | grep xargo || \
|
||||||
sort=sort
|
cargo install xargo
|
||||||
else
|
rustup component list | grep 'rust-src.*installed' || \
|
||||||
target=x86_64-apple-darwin
|
rustup component add rust-src
|
||||||
sort=gsort # for `sort --sort-version`, from brew's coreutils.
|
;;
|
||||||
fi
|
esac
|
||||||
|
|
||||||
# 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
|
@ -2,12 +2,17 @@ set -ex
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [ $TARGET = x86_64-unknown-linux-gnu ]; then
|
if [ $TARGET = x86_64-unknown-linux-gnu ]; then
|
||||||
|
cargo build
|
||||||
cargo test
|
cargo test
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cross build --target $TARGET
|
xargo build --target $TARGET
|
||||||
cross build --target $TARGET --release
|
for ex in $(ls examples/*); do
|
||||||
|
ex=$(basename $ex)
|
||||||
|
ex=${ex%.*}
|
||||||
|
xargo build --target $TARGET --example $ex
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
|
@ -63,6 +63,9 @@ task!(EXTI0, exti0);
|
||||||
fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
|
fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
|
||||||
// because this task has a priority of 1 the preemption threshold is also 1
|
// 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
|
// A
|
||||||
rtfm::bkpt();
|
rtfm::bkpt();
|
||||||
|
|
||||||
|
@ -70,7 +73,7 @@ fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
|
||||||
rtfm::set_pending(Interrupt::EXTI1); // ~> exti1
|
rtfm::set_pending(Interrupt::EXTI1); // ~> exti1
|
||||||
|
|
||||||
// a claim creates a critical section
|
// 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
|
// this claim increases the preemption threshold to 2
|
||||||
// just high enough to not race with task `exti1` for access to the
|
// just high enough to not race with task `exti1` for access to the
|
||||||
// `LOW` resource
|
// `LOW` resource
|
||||||
|
@ -90,7 +93,7 @@ fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
|
||||||
rtfm::bkpt();
|
rtfm::bkpt();
|
||||||
|
|
||||||
// claims can be nested
|
// claims can be nested
|
||||||
r.HIGH.claim_mut(t, |_high, _| {
|
high.claim_mut(t, |_high, _| {
|
||||||
// This claim increases the preemption threshold to 3
|
// This claim increases the preemption threshold to 3
|
||||||
|
|
||||||
// now `exti2` can't preempt this task
|
// now `exti2` can't preempt this task
|
||||||
|
|
|
@ -65,6 +65,9 @@
|
||||||
//! fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
|
//! fn exti0(t: &mut Threshold, r: EXTI0::Resources) {
|
||||||
//! // because this task has a priority of 1 the preemption threshold is also 1
|
//! // 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
|
//! // A
|
||||||
//! rtfm::bkpt();
|
//! rtfm::bkpt();
|
||||||
//!
|
//!
|
||||||
|
@ -72,7 +75,7 @@
|
||||||
//! rtfm::set_pending(Interrupt::EXTI1); // ~> exti1
|
//! rtfm::set_pending(Interrupt::EXTI1); // ~> exti1
|
||||||
//!
|
//!
|
||||||
//! // a claim creates a critical section
|
//! // 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
|
//! // this claim increases the preemption threshold to 2
|
||||||
//! // just high enough to not race with task `exti1` for access to the
|
//! // just high enough to not race with task `exti1` for access to the
|
||||||
//! // `LOW` resource
|
//! // `LOW` resource
|
||||||
|
@ -92,7 +95,7 @@
|
||||||
//! rtfm::bkpt();
|
//! rtfm::bkpt();
|
||||||
//!
|
//!
|
||||||
//! // claims can be nested
|
//! // claims can be nested
|
||||||
//! r.HIGH.claim_mut(t, |_high, _| {
|
//! high.claim_mut(t, |_high, _| {
|
||||||
//! // This claim increases the preemption threshold to 3
|
//! // This claim increases the preemption threshold to 3
|
||||||
//!
|
//!
|
||||||
//! // now `exti2` can't preempt this task
|
//! // now `exti2` can't preempt this task
|
||||||
|
|
Loading…
Reference in a new issue