Skip to content

Commit 0d94e3b

Browse files
committed
Fix tests.
1 parent 136bab0 commit 0d94e3b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.github/workflows/on-target.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Build testsuite
2323
env:
2424
RUSTFLAGS: -C link-arg=-Tlink.x -D warnings
25-
run: cargo build -p testsuite --target thumbv7m-none-eabi --features testsuite/semihosting
25+
run: cargo build -p testsuite --target thumbv7m-none-eabi --features semihosting,cortex-m/single-core-critical-section
2626
- name: Install QEMU
2727
run: sudo apt-get update && sudo apt-get install qemu qemu-system-arm
2828
- name: Run testsuite
@@ -51,7 +51,7 @@ jobs:
5151
- name: Build testsuite
5252
env:
5353
RUSTFLAGS: -C link-arg=-Tlink.x -D warnings
54-
run: cargo build -p testsuite --target thumbv6m-none-eabi --features testsuite/rtt
54+
run: cargo build -p testsuite --target thumbv6m-none-eabi --features rtt,cortex-m/single-core-critical-section
5555
- name: Upload testsuite binaries
5656
uses: actions/upload-artifact@v3
5757
with:

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ mod macros;
4949
pub mod asm;
5050
#[cfg(armv8m)]
5151
pub mod cmse;
52-
#[cfg(feature = "single-core-critical-section")]
52+
#[cfg(all(cortex_m, feature = "single-core-critical-section"))]
5353
mod critical_section;
5454
pub mod delay;
5555
pub mod interrupt;

testsuite/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ semihosting = ["cortex-m-semihosting", "minitest/semihosting"]
1313
cortex-m-rt.path = "../cortex-m-rt"
1414
cortex-m.path = ".."
1515
minitest.path = "minitest"
16+
critical-section = "0.2"
1617

1718
[dependencies.rtt-target]
1819
version = "0.3.1"

testsuite/minitest/macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ fn tests_impl(args: TokenStream, input: TokenStream) -> parse::Result<TokenStrea
215215
unsafe {
216216
::rtt_target::set_print_channel_cs(
217217
channels.up.0,
218-
&((|arg, f| cortex_m::interrupt::free(|_| f(arg)))
219-
as rtt_target::CriticalSectionFunc),
218+
&((|arg, f| ::critical_section::with(|_| f(arg)))
219+
as ::rtt_target::CriticalSectionFunc),
220220
);
221221
}
222222
});

0 commit comments

Comments
 (0)