diff options
| author | Ulf Lilleengen <[email protected]> | 2025-05-09 13:05:23 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-09 13:05:23 +0200 |
| commit | 64a2b9b2a36adbc26117b8e76ae2b178a5e3eb9f (patch) | |
| tree | 22fba36ec13d257189701e4a053b930032480cb3 /examples/stm32h7/src/bin | |
| parent | aa8703360e913ae39cf8f24aae4a68158b7d6208 (diff) | |
| parent | f5ddb9358f841d1a1e3a996eb30d7d9fd5d44d38 (diff) | |
Merge pull request #4170 from yutannihilation/chore/fix-unsafe-attribute-rust2024
chore: Wrap `link_section` attribute in example code with `unsafe()` for compatibility with Rust 2024 edition
Diffstat (limited to 'examples/stm32h7/src/bin')
| -rw-r--r-- | examples/stm32h7/src/bin/adc_dma.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/sai.rs | 4 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/spi_bdma.rs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/stm32h7/src/bin/adc_dma.rs b/examples/stm32h7/src/bin/adc_dma.rs index dc775f18a..f06b5d06e 100644 --- a/examples/stm32h7/src/bin/adc_dma.rs +++ b/examples/stm32h7/src/bin/adc_dma.rs | |||
| @@ -8,7 +8,7 @@ use embassy_stm32::Config; | |||
| 8 | use embassy_time::Timer; | 8 | use embassy_time::Timer; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | #[link_section = ".ram_d3"] | 11 | #[unsafe(link_section = ".ram_d3")] |
| 12 | static mut DMA_BUF: [u16; 2] = [0; 2]; | 12 | static mut DMA_BUF: [u16; 2] = [0; 2]; |
| 13 | 13 | ||
| 14 | #[embassy_executor::main] | 14 | #[embassy_executor::main] |
diff --git a/examples/stm32h7/src/bin/sai.rs b/examples/stm32h7/src/bin/sai.rs index 79a856b3b..01937593a 100644 --- a/examples/stm32h7/src/bin/sai.rs +++ b/examples/stm32h7/src/bin/sai.rs | |||
| @@ -16,9 +16,9 @@ const DMA_BUFFER_LENGTH: usize = HALF_DMA_BUFFER_LENGTH * 2; // 2 half-blocks | |||
| 16 | const SAMPLE_RATE: u32 = 48000; | 16 | const SAMPLE_RATE: u32 = 48000; |
| 17 | 17 | ||
| 18 | //DMA buffer must be in special region. Refer https://embassy.dev/book/#_stm32_bdma_only_working_out_of_some_ram_regions | 18 | //DMA buffer must be in special region. Refer https://embassy.dev/book/#_stm32_bdma_only_working_out_of_some_ram_regions |
| 19 | #[link_section = ".sram1_bss"] | 19 | #[unsafe(link_section = ".sram1_bss")] |
| 20 | static mut TX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit(); | 20 | static mut TX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit(); |
| 21 | #[link_section = ".sram1_bss"] | 21 | #[unsafe(link_section = ".sram1_bss")] |
| 22 | static mut RX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit(); | 22 | static mut RX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit(); |
| 23 | 23 | ||
| 24 | #[embassy_executor::main] | 24 | #[embassy_executor::main] |
diff --git a/examples/stm32h7/src/bin/spi_bdma.rs b/examples/stm32h7/src/bin/spi_bdma.rs index 9166fe9b6..5a7dff572 100644 --- a/examples/stm32h7/src/bin/spi_bdma.rs +++ b/examples/stm32h7/src/bin/spi_bdma.rs | |||
| @@ -16,7 +16,7 @@ use static_cell::StaticCell; | |||
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | // Defined in memory.x | 18 | // Defined in memory.x |
| 19 | #[link_section = ".ram_d3"] | 19 | #[unsafe(link_section = ".ram_d3")] |
| 20 | static mut RAM_D3: GroundedArrayCell<u8, 256> = GroundedArrayCell::uninit(); | 20 | static mut RAM_D3: GroundedArrayCell<u8, 256> = GroundedArrayCell::uninit(); |
| 21 | 21 | ||
| 22 | #[embassy_executor::task] | 22 | #[embassy_executor::task] |
