mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
Merge pull request #319 from AfoHT/fixoddex
Use cargo feature instead of conditional compilation hacks
This commit is contained in:
commit
4397fbf762
4 changed files with 40 additions and 29 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -94,7 +94,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
use-cross: false
|
use-cross: false
|
||||||
command: check
|
command: check
|
||||||
args: --examples --target=${{ matrix.target }}
|
args: --examples --target=${{ matrix.target }} --features __min_r1_43
|
||||||
|
|
||||||
- name: cargo check -p homogeneous
|
- name: cargo check -p homogeneous
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
|
|
|
@ -38,6 +38,10 @@ required-features = ["__v7"]
|
||||||
name = "t-cfg"
|
name = "t-cfg"
|
||||||
required-features = ["__v7"]
|
required-features = ["__v7"]
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "t-cfg-resources"
|
||||||
|
required-features = ["__min_r1_43"]
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "t-schedule"
|
name = "t-schedule"
|
||||||
required-features = ["__v7"]
|
required-features = ["__v7"]
|
||||||
|
@ -77,6 +81,7 @@ heterogeneous = ["cortex-m-rtfm-macros/heterogeneous", "microamp"]
|
||||||
homogeneous = ["cortex-m-rtfm-macros/homogeneous"]
|
homogeneous = ["cortex-m-rtfm-macros/homogeneous"]
|
||||||
# used for testing this crate; do not use in applications
|
# used for testing this crate; do not use in applications
|
||||||
__v7 =[]
|
__v7 =[]
|
||||||
|
__min_r1_43 =[]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|
10
ci/script.sh
10
ci/script.sh
|
@ -102,8 +102,18 @@ main() {
|
||||||
|
|
||||||
if [ $TARGET = thumbv6m-none-eabi ]; then
|
if [ $TARGET = thumbv6m-none-eabi ]; then
|
||||||
cargo check --target $T --examples
|
cargo check --target $T --examples
|
||||||
|
|
||||||
|
# Check examples with specific features not compatible with MSRV
|
||||||
|
if [[ $TRAVIS_RUST_VERSION != 1.*.* ]]; then
|
||||||
|
cargo check --target $T --examples --features __min_r1_43
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
cargo check --target $T --examples --features __v7
|
cargo check --target $T --examples --features __v7
|
||||||
|
|
||||||
|
# Check examples with specific features not compatible with MSRV
|
||||||
|
if [[ $TRAVIS_RUST_VERSION != 1.*.* ]]; then
|
||||||
|
cargo check --target $T --examples --features __v7,__min_r1_43
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cargo check -p homogeneous --target $T --examples
|
cargo check -p homogeneous --target $T --examples
|
||||||
|
|
|
@ -5,11 +5,8 @@
|
||||||
|
|
||||||
use panic_halt as _;
|
use panic_halt as _;
|
||||||
|
|
||||||
#[cfg(rustc_is_nightly)]
|
#[rtfm::app(device = lm3s6965)]
|
||||||
mod example {
|
const APP: () = {
|
||||||
|
|
||||||
#[rtfm::app(device = lm3s6965)]
|
|
||||||
const APP: () = {
|
|
||||||
struct Resources {
|
struct Resources {
|
||||||
// A resource
|
// A resource
|
||||||
#[init(0)]
|
#[init(0)]
|
||||||
|
@ -36,5 +33,4 @@ mod example {
|
||||||
fn idle(_cx: idle::Context) -> ! {
|
fn idle(_cx: idle::Context) -> ! {
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue