diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-01-19 16:32:30 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-19 16:32:30 +0000 |
| commit | 8fb11bcd9b0ea5df2c97751c04f32fcb6f03a943 (patch) | |
| tree | 4c7bc68c8e7606da2f8eb2819db1bb6c3d5e5fc9 | |
| parent | ddf8c99a938f7d2c4bb6e3ea9476c487c5b1c047 (diff) | |
| parent | b640c72092ff803dc0a70c02a82351156ceee9fd (diff) | |
Merge #583
583: misc nrf fixes r=Dirbaio a=Dirbaio
Co-authored-by: Dario Nieuwenhuis <[email protected]>
| -rwxr-xr-x | ci.sh | 10 | ||||
| -rw-r--r-- | embassy-nrf/src/util.rs | 6 |
2 files changed, 8 insertions, 8 deletions
| @@ -33,15 +33,15 @@ cargo batch \ | |||
| 33 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time-driver-rtc1 \ | 33 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time-driver-rtc1 \ |
| 34 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52820,gpiote,time-driver-rtc1 \ | 34 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52820,gpiote,time-driver-rtc1 \ |
| 35 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832,gpiote,time-driver-rtc1 \ | 35 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52832,gpiote,time-driver-rtc1 \ |
| 36 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833,gpiote,time-driver-rtc1 \ | 36 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52833,gpiote,time-driver-rtc1,unstable-traits \ |
| 37 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-s,gpiote,time-driver-rtc1 \ | 37 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-s,gpiote,time-driver-rtc1 \ |
| 38 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-ns,gpiote,time-driver-rtc1 \ | 38 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf9160-ns,gpiote,time-driver-rtc1,unstable-traits \ |
| 39 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-s,gpiote,time-driver-rtc1 \ | 39 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-s,gpiote,time-driver-rtc1,unstable-traits \ |
| 40 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-ns,gpiote,time-driver-rtc1 \ | 40 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-app-ns,gpiote,time-driver-rtc1 \ |
| 41 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-net,gpiote,time-driver-rtc1 \ | 41 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv8m.main-none-eabihf --features nrf5340-net,gpiote,time-driver-rtc1,unstable-traits \ |
| 42 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ | 42 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,gpiote,time-driver-rtc1 \ |
| 43 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,log,gpiote,time-driver-rtc1 \ | 43 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,log,gpiote,time-driver-rtc1 \ |
| 44 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,defmt,gpiote,time-driver-rtc1 \ | 44 | --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52840,defmt,gpiote,time-driver-rtc1,unstable-traits \ |
| 45 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt \ | 45 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt \ |
| 46 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log \ | 46 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log \ |
| 47 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt \ | 47 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt \ |
diff --git a/embassy-nrf/src/util.rs b/embassy-nrf/src/util.rs index 76162b701..b24bc452f 100644 --- a/embassy-nrf/src/util.rs +++ b/embassy-nrf/src/util.rs | |||
| @@ -4,18 +4,18 @@ const SRAM_LOWER: usize = 0x2000_0000; | |||
| 4 | const SRAM_UPPER: usize = 0x3000_0000; | 4 | const SRAM_UPPER: usize = 0x3000_0000; |
| 5 | 5 | ||
| 6 | // TODO: replace transmutes with core::ptr::metadata once it's stable | 6 | // TODO: replace transmutes with core::ptr::metadata once it's stable |
| 7 | 7 | pub(crate) fn slice_ptr_parts<T>(slice: *const [T]) -> (*const T, usize) { | |
| 8 | pub(crate) fn slice_ptr_parts<T>(slice: *const [T]) -> (usize, usize) { | ||
| 9 | unsafe { mem::transmute(slice) } | 8 | unsafe { mem::transmute(slice) } |
| 10 | } | 9 | } |
| 11 | 10 | ||
| 12 | pub(crate) fn slice_ptr_parts_mut<T>(slice: *mut [T]) -> (usize, usize) { | 11 | pub(crate) fn slice_ptr_parts_mut<T>(slice: *mut [T]) -> (*mut T, usize) { |
| 13 | unsafe { mem::transmute(slice) } | 12 | unsafe { mem::transmute(slice) } |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 16 | /// Does this slice reside entirely within RAM? | 15 | /// Does this slice reside entirely within RAM? |
| 17 | pub(crate) fn slice_in_ram<T>(slice: *const [T]) -> bool { | 16 | pub(crate) fn slice_in_ram<T>(slice: *const [T]) -> bool { |
| 18 | let (ptr, len) = slice_ptr_parts(slice); | 17 | let (ptr, len) = slice_ptr_parts(slice); |
| 18 | let ptr = ptr as usize; | ||
| 19 | ptr >= SRAM_LOWER && (ptr + len * core::mem::size_of::<T>()) < SRAM_UPPER | 19 | ptr >= SRAM_LOWER && (ptr + len * core::mem::size_of::<T>()) < SRAM_UPPER |
| 20 | } | 20 | } |
| 21 | 21 | ||
