Removing DBM from input stamper

This commit is contained in:
Ryan Summers 2020-12-08 11:29:59 +01:00
parent 85100a7d8f
commit f2e4f497fa

View File

@ -1,7 +1,7 @@
use super::{SAMPLE_BUFFER_SIZE, hal, timers, DmaConfig, PeripheralToMemory, Transfer}; use super::{SAMPLE_BUFFER_SIZE, hal, timers, DmaConfig, PeripheralToMemory, Transfer};
#[link_section = ".axisram.buffers"] #[link_section = ".axisram.buffers"]
static mut BUF: [[u16; SAMPLE_BUFFER_SIZE]; 3] = [[0; SAMPLE_BUFFER_SIZE]; 3]; static mut BUF: [[u16; SAMPLE_BUFFER_SIZE]; 2] = [[0; SAMPLE_BUFFER_SIZE]; 2];
pub struct InputStamper { pub struct InputStamper {
_di0_trigger: hal::gpio::gpioa::PA3<hal::gpio::Alternate<hal::gpio::AF2>>, _di0_trigger: hal::gpio::gpioa::PA3<hal::gpio::Alternate<hal::gpio::AF2>>,
@ -30,25 +30,23 @@ impl InputStamper {
let dma_config = DmaConfig::default() let dma_config = DmaConfig::default()
.transfer_complete_interrupt(true) .transfer_complete_interrupt(true)
.memory_increment(true) .memory_increment(true)
.circular_buffer(true)
.double_buffer(true)
.peripheral_increment(false); .peripheral_increment(false);
// This needs to operate in double-buffer+circular mode so that we don't potentially drop // TODO: This needs to operate in double-buffer+circular mode so that we don't potentially
// input timestamps. // drop input timestamps.
let mut timestamp_transfer: Transfer<_, _, PeripheralToMemory, _> = let mut timestamp_transfer: Transfer<_, _, PeripheralToMemory, _> =
Transfer::init( Transfer::init(
stream, stream,
input_capture, input_capture,
unsafe { &mut BUF[0] }, unsafe { &mut BUF[0] },
unsafe { Some(&mut BUF[1]) }, None,
dma_config, dma_config,
); );
timestamp_transfer.start(|_| {}); timestamp_transfer.start(|_| {});
Self { Self {
next_buffer: unsafe { Some(&mut BUF[2]) }, next_buffer: unsafe { Some(&mut BUF[1]) },
transfer: timestamp_transfer, transfer: timestamp_transfer,
_di0_trigger: trigger, _di0_trigger: trigger,
} }