mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 00:02:28 +00:00
fix adc/ringbuffered_v2.rs
This commit is contained in:
parent
2ec05da5dd
commit
d280b23428
@ -6,11 +6,13 @@ use embassy_hal_internal::{into_ref, Peripheral};
|
||||
use stm32_metapac::adc::vals::SampleTime;
|
||||
|
||||
use crate::adc::{Adc, AdcChannel, Instance, RxDma};
|
||||
use crate::dma::ringbuffer::OverrunError;
|
||||
use crate::dma::{Priority, ReadableRingBuffer, TransferOptions};
|
||||
use crate::pac::adc::vals;
|
||||
use crate::rcc;
|
||||
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
pub struct OverrunError;
|
||||
|
||||
fn clear_interrupt_flags(r: crate::pac::adc::Adc) {
|
||||
r.sr().modify(|regs| {
|
||||
regs.set_eoc(false);
|
||||
|
@ -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
|
||||
/// 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
|
||||
|
@ -296,6 +296,9 @@ mod dual_core {
|
||||
/// 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"]
|
||||
/// static SHARED_DATA: MaybeUninit<SharedData> = MaybeUninit::uninit();
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user