ci: don't install cargo-edit
This commit is contained in:
@@ -2,8 +2,6 @@ set -euxo pipefail
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
rustup target add $TARGET
|
rustup target add $TARGET
|
||||||
|
|
||||||
cargo install cargo-edit || true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
33
ci/script.sh
33
ci/script.sh
@@ -17,9 +17,7 @@ EOF
|
|||||||
|
|
||||||
local examples=(
|
local examples=(
|
||||||
crash
|
crash
|
||||||
# device
|
|
||||||
hello
|
hello
|
||||||
itm
|
|
||||||
override-exception-handler
|
override-exception-handler
|
||||||
panic
|
panic
|
||||||
)
|
)
|
||||||
@@ -28,13 +26,29 @@ EOF
|
|||||||
cargo build --target $TARGET --example $ex --release
|
cargo build --target $TARGET --example $ex --release
|
||||||
done
|
done
|
||||||
|
|
||||||
cargo add alloc-cortex-m
|
# ITM is not available on Cortex-M0
|
||||||
|
if [ $TARGET != thumbv6m-none-eabi ]; then
|
||||||
|
local ex=itm
|
||||||
|
cargo build --target $TARGET --example $ex
|
||||||
|
cargo build --target $TARGET --example $ex --release
|
||||||
|
|
||||||
cargo build --target $TARGET --example allocator
|
examples+=( $ex )
|
||||||
cargo build --target $TARGET --example allocator --release
|
|
||||||
|
|
||||||
examples+=( allocator )
|
fi
|
||||||
|
|
||||||
|
# Allocator example needs an extra dependency
|
||||||
|
cat >>Cargo.toml <<'EOF'
|
||||||
|
[dependencies.alloc-cortex-m]
|
||||||
|
version = "0.3.3"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
local ex=allocator
|
||||||
|
cargo build --target $TARGET --example $ex
|
||||||
|
cargo build --target $TARGET --example $ex --release
|
||||||
|
|
||||||
|
examples+=( $ex )
|
||||||
|
|
||||||
|
# Device example needs an extra dependency
|
||||||
if [ $TARGET = thumbv7m-none-eabi ]; then
|
if [ $TARGET = thumbv7m-none-eabi ]; then
|
||||||
cat >>Cargo.toml <<'EOF'
|
cat >>Cargo.toml <<'EOF'
|
||||||
[dependencies.stm32f103xx]
|
[dependencies.stm32f103xx]
|
||||||
@@ -42,10 +56,11 @@ features = ["rt"]
|
|||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cargo build --target $TARGET --example device
|
local ex=device
|
||||||
cargo build --target $TARGET --example device --release
|
cargo build --target $TARGET --example $ex
|
||||||
|
cargo build --target $TARGET --example $ex --release
|
||||||
|
|
||||||
examples+=( device )
|
examples+=( $ex )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IFS=,;eval arm-none-eabi-size target/$TARGET/release/examples/"{${examples[*]}}"
|
IFS=,;eval arm-none-eabi-size target/$TARGET/release/examples/"{${examples[*]}}"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate cortex_m;
|
extern crate cortex_m;
|
||||||
extern crate cortex_m_rt;
|
extern crate cortex_m_rt;
|
||||||
extern crate panic_itm; // panicking behavior
|
extern crate panic_abort; // panicking behavior
|
||||||
|
|
||||||
use cortex_m::{asm, Peripherals};
|
use cortex_m::{asm, Peripherals};
|
||||||
|
|
||||||
@@ -27,9 +27,6 @@ fn main() {
|
|||||||
let mut itm = p.ITM;
|
let mut itm = p.ITM;
|
||||||
|
|
||||||
iprintln!(&mut itm.stim[0], "Hello, world!");
|
iprintln!(&mut itm.stim[0], "Hello, world!");
|
||||||
|
|
||||||
// Also prints the panic message to the ITM
|
|
||||||
panic!("Oops");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// As we are not using interrupts, we just register a dummy catch all handler
|
// As we are not using interrupts, we just register a dummy catch all handler
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
//! #[macro_use]
|
//! #[macro_use]
|
||||||
//! extern crate cortex_m;
|
//! extern crate cortex_m;
|
||||||
//! extern crate cortex_m_rt;
|
//! extern crate cortex_m_rt;
|
||||||
//! extern crate panic_itm; // panicking behavior
|
//! extern crate panic_abort; // panicking behavior
|
||||||
//!
|
//!
|
||||||
//! use cortex_m::{asm, Peripherals};
|
//! use cortex_m::{asm, Peripherals};
|
||||||
//!
|
//!
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
//! let mut itm = p.ITM;
|
//! let mut itm = p.ITM;
|
||||||
//!
|
//!
|
||||||
//! iprintln!(&mut itm.stim[0], "Hello, world!");
|
//! iprintln!(&mut itm.stim[0], "Hello, world!");
|
||||||
//!
|
|
||||||
//! // Also prints the panic message to the ITM
|
|
||||||
//! panic!("Oops");
|
|
||||||
//! }
|
//! }
|
||||||
//!
|
//!
|
||||||
//! // As we are not using interrupts, we just register a dummy catch all handler
|
//! // As we are not using interrupts, we just register a dummy catch all handler
|
||||||
|
|||||||
Reference in New Issue
Block a user