diff options
| author | Caleb Jamison <[email protected]> | 2024-08-12 05:47:16 -0400 |
|---|---|---|
| committer | Caleb Jamison <[email protected]> | 2024-08-12 05:47:16 -0400 |
| commit | 13cb4314725bb60d2252575f8fd06828e8661064 (patch) | |
| tree | 557ea01cb6545b7f3da792f617c1a9b10ff2b85a | |
| parent | 752fbc662a43b677b7ffb7672b01772b28ff4e1f (diff) | |
Enable rp235x doc tests, fixup feature doc
The rp235x doc test requires an unfortunate workaround using a private
feature, "_test", in order compile.
| -rwxr-xr-x | .github/ci/test.sh | 3 | ||||
| -rw-r--r-- | embassy-rp/Cargo.toml | 11 | ||||
| -rw-r--r-- | embassy-rp/src/lib.rs | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/.github/ci/test.sh b/.github/ci/test.sh index 771251bd1..da0021684 100755 --- a/.github/ci/test.sh +++ b/.github/ci/test.sh | |||
| @@ -21,7 +21,8 @@ cargo test --manifest-path ./embassy-boot/Cargo.toml --features ed25519-salty | |||
| 21 | 21 | ||
| 22 | cargo test --manifest-path ./embassy-nrf/Cargo.toml --no-default-features --features nrf52840,time-driver-rtc1,gpiote | 22 | cargo test --manifest-path ./embassy-nrf/Cargo.toml --no-default-features --features nrf52840,time-driver-rtc1,gpiote |
| 23 | 23 | ||
| 24 | cargo test --manifest-path ./embassy-rp/Cargo.toml --no-default-features --features time-driver,rp2040 | 24 | cargo test --manifest-path ./embassy-rp/Cargo.toml --no-default-features --features time-driver,rp2040,_test |
| 25 | cargo test --manifest-path ./embassy-rp/Cargo.toml --no-default-features --features time-driver,rp235xa,_test | ||
| 25 | 26 | ||
| 26 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features stm32f429vg,exti,time-driver-any,exti | 27 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features stm32f429vg,exti,time-driver-any,exti |
| 27 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features stm32f732ze,exti,time-driver-any,exti | 28 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features stm32f732ze,exti,time-driver-any,exti |
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 1ab6cf440..453f1aa0f 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -98,10 +98,13 @@ rp235xa = ["_rp235x"] | |||
| 98 | ## Configure the hal for use with the rp235xB | 98 | ## Configure the hal for use with the rp235xB |
| 99 | rp235xb = ["_rp235x"] | 99 | rp235xb = ["_rp235x"] |
| 100 | 100 | ||
| 101 | # Add a binary-info header block containing picotool-compatible metadata. | 101 | # hack around cortex-m peripherals being wrong when running tests. |
| 102 | # | 102 | _test = [] |
| 103 | # Takes up a little flash space, but picotool can then report the name of your | 103 | |
| 104 | # program and other details. | 104 | ## Add a binary-info header block containing picotool-compatible metadata. |
| 105 | ## | ||
| 106 | ## Takes up a little flash space, but picotool can then report the name of your | ||
| 107 | ## program and other details. | ||
| 105 | binary-info = [ "rt" ] | 108 | binary-info = [ "rt" ] |
| 106 | 109 | ||
| 107 | [dependencies] | 110 | [dependencies] |
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs index f968572b3..1fc397107 100644 --- a/embassy-rp/src/lib.rs +++ b/embassy-rp/src/lib.rs | |||
| @@ -469,7 +469,7 @@ pub fn install_core0_stack_guard() -> Result<(), ()> { | |||
| 469 | unsafe { install_stack_guard(core::ptr::addr_of_mut!(_stack_end)) } | 469 | unsafe { install_stack_guard(core::ptr::addr_of_mut!(_stack_end)) } |
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | #[cfg(feature = "rp2040")] | 472 | #[cfg(all(feature = "rp2040", not(feature = "_test")))] |
| 473 | #[inline(always)] | 473 | #[inline(always)] |
| 474 | fn install_stack_guard(stack_bottom: *mut usize) -> Result<(), ()> { | 474 | fn install_stack_guard(stack_bottom: *mut usize) -> Result<(), ()> { |
| 475 | let core = unsafe { cortex_m::Peripherals::steal() }; | 475 | let core = unsafe { cortex_m::Peripherals::steal() }; |
| @@ -497,7 +497,7 @@ fn install_stack_guard(stack_bottom: *mut usize) -> Result<(), ()> { | |||
| 497 | Ok(()) | 497 | Ok(()) |
| 498 | } | 498 | } |
| 499 | 499 | ||
| 500 | #[cfg(all(feature = "_rp235x", not(test)))] | 500 | #[cfg(all(feature = "_rp235x", not(feature = "_test")))] |
| 501 | #[inline(always)] | 501 | #[inline(always)] |
| 502 | fn install_stack_guard(stack_bottom: *mut usize) -> Result<(), ()> { | 502 | fn install_stack_guard(stack_bottom: *mut usize) -> Result<(), ()> { |
| 503 | let core = unsafe { cortex_m::Peripherals::steal() }; | 503 | let core = unsafe { cortex_m::Peripherals::steal() }; |
| @@ -517,7 +517,7 @@ fn install_stack_guard(stack_bottom: *mut usize) -> Result<(), ()> { | |||
| 517 | 517 | ||
| 518 | // This is to hack around cortex_m defaulting to ARMv7 when building tests, | 518 | // This is to hack around cortex_m defaulting to ARMv7 when building tests, |
| 519 | // so the compile fails when we try to use ARMv8 peripherals. | 519 | // so the compile fails when we try to use ARMv8 peripherals. |
| 520 | #[cfg(test)] | 520 | #[cfg(feature = "_test")] |
| 521 | #[inline(always)] | 521 | #[inline(always)] |
| 522 | fn install_stack_guard(_stack_bottom: *mut usize) -> Result<(), ()> { | 522 | fn install_stack_guard(_stack_bottom: *mut usize) -> Result<(), ()> { |
| 523 | Ok(()) | 523 | Ok(()) |
