fix adc/ringbuffered_v2.rs

This commit is contained in:
Alexandros Liarokapis 2024-10-03 13:04:15 +03:00
parent 2ec05da5dd
commit d280b23428
3 changed files with 8 additions and 2 deletions

View File

@ -6,11 +6,13 @@ use embassy_hal_internal::{into_ref, Peripheral};
use stm32_metapac::adc::vals::SampleTime; use stm32_metapac::adc::vals::SampleTime;
use crate::adc::{Adc, AdcChannel, Instance, RxDma}; use crate::adc::{Adc, AdcChannel, Instance, RxDma};
use crate::dma::ringbuffer::OverrunError;
use crate::dma::{Priority, ReadableRingBuffer, TransferOptions}; use crate::dma::{Priority, ReadableRingBuffer, TransferOptions};
use crate::pac::adc::vals; use crate::pac::adc::vals;
use crate::rcc; use crate::rcc;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct OverrunError;
fn clear_interrupt_flags(r: crate::pac::adc::Adc) { fn clear_interrupt_flags(r: crate::pac::adc::Adc) {
r.sr().modify(|regs| { r.sr().modify(|regs| {
regs.set_eoc(false); regs.set_eoc(false);

View File

@ -119,7 +119,8 @@ impl<'a, W: Word> ReadableDmaRingBuffer<'a, W> {
} }
} }
/// Read elements from the ring buffer /// Read elements from the ring buffer.
///
/// Return a tuple of the length read and the length remaining in the buffer /// Return a tuple of the length read and the length remaining in the buffer
/// If not all of the elements were read, then there will be some elements in the buffer remaining /// If not all of the elements were read, then there will be some elements in the buffer remaining
/// The length remaining is the capacity, ring_buf.len(), less the elements remaining after the read /// The length remaining is the capacity, ring_buf.len(), less the elements remaining after the read

View File

@ -296,6 +296,9 @@ mod dual_core {
/// It cannot be initialized by the user. The intended use is: /// It cannot be initialized by the user. The intended use is:
/// ///
/// ``` /// ```
/// use core::mem::MaybeUninit;
/// use embassy_stm32::{init_secondary, SharedData};
///
/// #[link_section = ".ram_d3"] /// #[link_section = ".ram_d3"]
/// static SHARED_DATA: MaybeUninit<SharedData> = MaybeUninit::uninit(); /// static SHARED_DATA: MaybeUninit<SharedData> = MaybeUninit::uninit();
/// ///