From 6cdee93934f55c06c6bb6cee94f5f70ec1384220 Mon Sep 17 00:00:00 2001 From: Tyler Gilbert Date: Fri, 29 Sep 2023 21:27:15 -0500 Subject: [PATCH] #Issue 1974 fix more warnings treated as errors --- embassy-stm32/src/rcc/f4.rs | 2 +- embassy-stm32/src/sai/mod.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/embassy-stm32/src/rcc/f4.rs b/embassy-stm32/src/rcc/f4.rs index 17834784..2f851cfa 100644 --- a/embassy-stm32/src/rcc/f4.rs +++ b/embassy-stm32/src/rcc/f4.rs @@ -97,7 +97,7 @@ fn setup_i2s_pll(vco_in: u32, plli2s: Option) -> Option { } #[cfg(not(any(stm32f427, stm32f429, stm32f437, stm32f439, stm32f446, stm32f469, stm32f479)))] -fn setup_sai_pll(vco_in: u32, _pllsai: Option) -> Option { +fn setup_sai_pll(_vco_in: u32, _pllsai: Option) -> Option { None } diff --git a/embassy-stm32/src/sai/mod.rs b/embassy-stm32/src/sai/mod.rs index aa996a99..d2949e9a 100644 --- a/embassy-stm32/src/sai/mod.rs +++ b/embassy-stm32/src/sai/mod.rs @@ -3,7 +3,7 @@ use embassy_embedded_hal::SetConfig; use embassy_hal_internal::{into_ref, PeripheralRef}; -use crate::dma::{Channel, ReadableRingBuffer, TransferOptions, WritableRingBuffer}; +use crate::dma::{ringbuffer, Channel, ReadableRingBuffer, TransferOptions, WritableRingBuffer}; use crate::gpio::sealed::{AFType, Pin as _}; use crate::gpio::AnyPin; use crate::pac::sai::{vals, Sai as Regs}; @@ -17,6 +17,13 @@ pub use crate::dma::word; pub enum Error { NotATransmitter, NotAReceiver, + OverrunError, +} + +impl From for Error { + fn from(_: ringbuffer::OverrunError) -> Self { + Self::OverrunError + } } #[derive(Copy, Clone)] @@ -499,6 +506,7 @@ pub enum SubBlock { enum RingBuffer<'d, C: Channel, W: word::Word> { Writable(WritableRingBuffer<'d, C, W>), + #[allow(dead_code)] // remove this after implementing new_* functions for receiver Readable(ReadableRingBuffer<'d, C, W>), }