aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin
diff options
context:
space:
mode:
authorHiroaki Yutani <[email protected]>2025-05-06 09:09:22 +0900
committerHiroaki Yutani <[email protected]>2025-05-06 09:09:22 +0900
commit0460a924ac06a7dd33b4e50396948ba9bcb5374e (patch)
tree8d9dc305d058709557e61674bf28e7ae3637b142 /examples/stm32h7/src/bin
parent93ff90db04f06316f0992b65a0319ebdf74ce5c4 (diff)
chore: Wrap link_section attribute with unsafe
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 95ffe257a..c2bf7d6f2 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]