Skip to content

Commit

Permalink
fix adc/ringbuffered_v2.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
liarokapisv committed Oct 3, 2024
1 parent d1fd568 commit 3ccceac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion embassy-stm32/src/adc/ringbuffered_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion embassy-stm32/src/dma/ringbuffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions embassy-stm32/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
///
Expand Down

0 comments on commit 3ccceac

Please sign in to comment.