aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xci.sh1
-rw-r--r--examples/stm32h723/src/bin/spdifrx.rs24
2 files changed, 13 insertions, 12 deletions
diff --git a/ci.sh b/ci.sh
index 33152e559..e54112359 100755
--- a/ci.sh
+++ b/ci.sh
@@ -246,6 +246,7 @@ cargo batch \
246 --- build --release --manifest-path examples/stm32h5/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32h5 \ 246 --- build --release --manifest-path examples/stm32h5/Cargo.toml --target thumbv8m.main-none-eabihf --artifact-dir out/examples/stm32h5 \
247 --- build --release --manifest-path examples/stm32h7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7 \ 247 --- build --release --manifest-path examples/stm32h7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7 \
248 --- build --release --manifest-path examples/stm32h7b0/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7b0 \ 248 --- build --release --manifest-path examples/stm32h7b0/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h7b0 \
249 --- build --release --manifest-path examples/stm32h723/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h723 \
249 --- build --release --manifest-path examples/stm32h735/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h735 \ 250 --- build --release --manifest-path examples/stm32h735/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h735 \
250 --- build --release --manifest-path examples/stm32h755cm4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h755cm4 \ 251 --- build --release --manifest-path examples/stm32h755cm4/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h755cm4 \
251 --- build --release --manifest-path examples/stm32h755cm7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h755cm7 \ 252 --- build --release --manifest-path examples/stm32h755cm7/Cargo.toml --target thumbv7em-none-eabi --artifact-dir out/examples/stm32h755cm7 \
diff --git a/examples/stm32h723/src/bin/spdifrx.rs b/examples/stm32h723/src/bin/spdifrx.rs
index a04d7cb34..6d29e8a4d 100644
--- a/examples/stm32h723/src/bin/spdifrx.rs
+++ b/examples/stm32h723/src/bin/spdifrx.rs
@@ -7,9 +7,9 @@
7 7
8use defmt::{info, trace}; 8use defmt::{info, trace};
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_futures::select::{self, select, Either}; 10use embassy_futures::select::{select, Either};
11use embassy_stm32::spdifrx::{self, Spdifrx}; 11use embassy_stm32::spdifrx::{self, Spdifrx};
12use embassy_stm32::{bind_interrupts, peripherals, sai}; 12use embassy_stm32::{bind_interrupts, peripherals, sai, Peri};
13use grounded::uninit::GroundedArrayCell; 13use grounded::uninit::GroundedArrayCell;
14use hal::sai::*; 14use hal::sai::*;
15use {defmt_rtt as _, embassy_stm32 as hal, panic_probe as _}; 15use {defmt_rtt as _, embassy_stm32 as hal, panic_probe as _};
@@ -25,10 +25,10 @@ const DMA_BUFFER_LENGTH: usize = HALF_DMA_BUFFER_LENGTH * 2; // 2 half-blocks
25 25
26// DMA buffers must be in special regions. Refer https://embassy.dev/book/#_stm32_bdma_only_working_out_of_some_ram_regions 26// DMA buffers must be in special regions. Refer https://embassy.dev/book/#_stm32_bdma_only_working_out_of_some_ram_regions
27#[unsafe(link_section = ".sram1")] 27#[unsafe(link_section = ".sram1")]
28static mut SPDIFRX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit(); 28static SPDIFRX_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit();
29 29
30#[unsafe(link_section = ".sram4")] 30#[unsafe(link_section = ".sram4")]
31static mut SAI_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit(); 31static SAI_BUFFER: GroundedArrayCell<u32, DMA_BUFFER_LENGTH> = GroundedArrayCell::uninit();
32 32
33#[embassy_executor::main] 33#[embassy_executor::main]
34async fn main(_spawner: Spawner) { 34async fn main(_spawner: Spawner) {
@@ -144,9 +144,9 @@ async fn main(_spawner: Spawner) {
144/// 144///
145/// Used (again) after dropping the SPDIFRX instance, in case of errors (e.g. source disconnect). 145/// Used (again) after dropping the SPDIFRX instance, in case of errors (e.g. source disconnect).
146fn new_spdif_receiver<'d>( 146fn new_spdif_receiver<'d>(
147 spdifrx: &'d mut peripherals::SPDIFRX1, 147 spdifrx: Peri<'d, peripherals::SPDIFRX1>,
148 input_pin: &'d mut peripherals::PD7, 148 input_pin: Peri<'d, peripherals::PD7>,
149 dma: &'d mut peripherals::DMA2_CH7, 149 dma: Peri<'d, peripherals::DMA2_CH7>,
150 buf: &'d mut [u32], 150 buf: &'d mut [u32],
151) -> Spdifrx<'d, peripherals::SPDIFRX1> { 151) -> Spdifrx<'d, peripherals::SPDIFRX1> {
152 Spdifrx::new(spdifrx, Irqs, spdifrx::Config::default(), input_pin, dma, buf) 152 Spdifrx::new(spdifrx, Irqs, spdifrx::Config::default(), input_pin, dma, buf)
@@ -156,11 +156,11 @@ fn new_spdif_receiver<'d>(
156/// 156///
157/// Used (again) after dropping the SAI4 instance, in case of errors (e.g. buffer overrun). 157/// Used (again) after dropping the SAI4 instance, in case of errors (e.g. buffer overrun).
158fn new_sai_transmitter<'d>( 158fn new_sai_transmitter<'d>(
159 sai: &'d mut peripherals::SAI4, 159 sai: Peri<'d, peripherals::SAI4>,
160 sck: &'d mut peripherals::PD13, 160 sck: Peri<'d, peripherals::PD13>,
161 sd: &'d mut peripherals::PC1, 161 sd: Peri<'d, peripherals::PC1>,
162 fs: &'d mut peripherals::PD12, 162 fs: Peri<'d, peripherals::PD12>,
163 dma: &'d mut peripherals::BDMA_CH0, 163 dma: Peri<'d, peripherals::BDMA_CH0>,
164 buf: &'d mut [u32], 164 buf: &'d mut [u32],
165) -> Sai<'d, peripherals::SAI4, u32> { 165) -> Sai<'d, peripherals::SAI4, u32> {
166 let mut sai_config = hal::sai::Config::default(); 166 let mut sai_config = hal::sai::Config::default();