Skip to content

Commit 72b23f0

Browse files
committed
ci: don't install cargo-edit
1 parent 2cd4ea3 commit 72b23f0

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

ci/install.sh

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ set -euxo pipefail
22

33
main() {
44
rustup target add $TARGET
5-
6-
cargo install cargo-edit || true
75
}
86

97
main

ci/script.sh

+24-9
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ EOF
1717

1818
local examples=(
1919
crash
20-
# device
2120
hello
22-
itm
2321
override-exception-handler
2422
panic
2523
)
@@ -28,24 +26,41 @@ EOF
2826
cargo build --target $TARGET --example $ex --release
2927
done
3028

31-
cargo add alloc-cortex-m
29+
# ITM is not available on Cortex-M0
30+
if [ $TARGET != thumbv6m-none-eabi ]; then
31+
local ex=itm
32+
cargo build --target $TARGET --example $ex
33+
cargo build --target $TARGET --example $ex --release
3234

33-
cargo build --target $TARGET --example allocator
34-
cargo build --target $TARGET --example allocator --release
35+
examples+=( $ex )
3536

36-
examples+=( allocator )
37+
fi
38+
39+
# Allocator example needs an extra dependency
40+
cat >>Cargo.toml <<'EOF'
41+
[dependencies.alloc-cortex-m]
42+
version = "0.3.3"
43+
EOF
3744

45+
local ex=allocator
46+
cargo build --target $TARGET --example $ex
47+
cargo build --target $TARGET --example $ex --release
48+
49+
examples+=( $ex )
50+
51+
# Device example needs an extra dependency
3852
if [ $TARGET = thumbv7m-none-eabi ]; then
3953
cat >>Cargo.toml <<'EOF'
4054
[dependencies.stm32f103xx]
4155
features = ["rt"]
4256
version = "0.9.0"
4357
EOF
4458

45-
cargo build --target $TARGET --example device
46-
cargo build --target $TARGET --example device --release
59+
local ex=device
60+
cargo build --target $TARGET --example $ex
61+
cargo build --target $TARGET --example $ex --release
4762

48-
examples+=( device )
63+
examples+=( $ex )
4964
fi
5065

5166
IFS=,;eval arm-none-eabi-size target/$TARGET/release/examples/"{${examples[*]}}"

examples/itm.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#[macro_use]
1919
extern crate cortex_m;
2020
extern crate cortex_m_rt;
21-
extern crate panic_itm; // panicking behavior
21+
extern crate panic_abort; // panicking behavior
2222

2323
use cortex_m::{asm, Peripherals};
2424

@@ -27,9 +27,6 @@ fn main() {
2727
let mut itm = p.ITM;
2828

2929
iprintln!(&mut itm.stim[0], "Hello, world!");
30-
31-
// Also prints the panic message to the ITM
32-
panic!("Oops");
3330
}
3431

3532
// As we are not using interrupts, we just register a dummy catch all handler

src/examples/_1_itm.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
//! #[macro_use]
2121
//! extern crate cortex_m;
2222
//! extern crate cortex_m_rt;
23-
//! extern crate panic_itm; // panicking behavior
23+
//! extern crate panic_abort; // panicking behavior
2424
//!
2525
//! use cortex_m::{asm, Peripherals};
2626
//!
@@ -29,9 +29,6 @@
2929
//! let mut itm = p.ITM;
3030
//!
3131
//! iprintln!(&mut itm.stim[0], "Hello, world!");
32-
//!
33-
//! // Also prints the panic message to the ITM
34-
//! panic!("Oops");
3532
//! }
3633
//!
3734
//! // As we are not using interrupts, we just register a dummy catch all handler

0 commit comments

Comments
 (0)