aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2025-05-09 13:05:23 +0200
committerGitHub <[email protected]>2025-05-09 13:05:23 +0200
commit64a2b9b2a36adbc26117b8e76ae2b178a5e3eb9f (patch)
tree22fba36ec13d257189701e4a053b930032480cb3 /examples/stm32h7/src/bin
parentaa8703360e913ae39cf8f24aae4a68158b7d6208 (diff)
parentf5ddb9358f841d1a1e3a996eb30d7d9fd5d44d38 (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.rs2
-rw-r--r--examples/stm32h7/src/bin/sai.rs4
-rw-r--r--examples/stm32h7/src/bin/spi_bdma.rs2
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;
8use embassy_time::Timer; 8use embassy_time::Timer;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[link_section = ".ram_d3"] 11#[unsafe(link_section = ".ram_d3")]
12static mut DMA_BUF: [u16; 2] = [0; 2]; 12static 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
16const SAMPLE_RATE: u32 = 48000; 16const 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")]
20static mut TX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit(); 20static mut TX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit();
21#[link_section = ".sram1_bss"] 21#[unsafe(link_section = ".sram1_bss")]
22static mut RX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit(); 22static 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;
16use {defmt_rtt as _, panic_probe as _}; 16use {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")]
20static mut RAM_D3: GroundedArrayCell<u8, 256> = GroundedArrayCell::uninit(); 20static mut RAM_D3: GroundedArrayCell<u8, 256> = GroundedArrayCell::uninit();
21 21
22#[embassy_executor::task] 22#[embassy_executor::task]