Skip to content
Snippets Groups Projects
Commit 8a2bfd69 authored by Per Lindgren's avatar Per Lindgren
Browse files

cleaning up

parent 87a48ef2
No related branches found
No related tags found
No related merge requests found
...@@ -219,10 +219,7 @@ pub mod dma1 { ...@@ -219,10 +219,7 @@ pub mod dma1 {
fn start_transfer_s6_c4(ndtr: u16, par: u32, m0: u32) { fn start_transfer_s6_c4(ndtr: u16, par: u32, m0: u32) {
let dma = unsafe { &*DMA1::ptr() }; let dma = unsafe { &*DMA1::ptr() };
asm::bkpt();
ipln!("ndtr {:04x}", ndtr);
ipln!("par {:08x}", par);
ipln!("m0 {:08x}", m0);
// nr data transfers // nr data transfers
dma.s6ndtr.write(|w| unsafe { w.ndt().bits(ndtr) }); dma.s6ndtr.write(|w| unsafe { w.ndt().bits(ndtr) });
// peripheral address // peripheral address
...@@ -271,7 +268,6 @@ pub mod dma1 { ...@@ -271,7 +268,6 @@ pub mod dma1 {
fn split(self, ahb1: &mut AHB1) -> Streams { fn split(self, ahb1: &mut AHB1) -> Streams {
//ahb.ahb1enr().modify(|_, w| w.dma1en().set_bit()); //ahb.ahb1enr().modify(|_, w| w.dma1en().set_bit());
// power and clk to dma1 // power and clk to dma1
ipln!("dma1en");
ahb1.enr().modify(|_, w| w.dma1en().set_bit()); ahb1.enr().modify(|_, w| w.dma1en().set_bit());
// // reset the DMA control registers (stops all on-going transfers) // // reset the DMA control registers (stops all on-going transfers)
...@@ -301,13 +297,8 @@ pub mod dma1 { ...@@ -301,13 +297,8 @@ pub mod dma1 {
// from or writing to a reserved address space". I think it's impossible // from or writing to a reserved address space". I think it's impossible
// to get to that state with our type safe API and *safe* Rust. // to get to that state with our type safe API and *safe* Rust.
let dma = unsafe { &*DMA1::ptr() }; let dma = unsafe { &*DMA1::ptr() };
let mut nr = 0;
asm::bkpt();
while dma.hisr.read().tcif6().bit_is_clear() { while dma.hisr.read().tcif6().bit_is_clear() {}
nr += 1;
}
asm::bkpt();
dma.hifcr.write(|w| w.ctcif6().set_bit()); dma.hifcr.write(|w| w.ctcif6().set_bit());
dma.s6cr.modify(|_, w| w.en().clear_bit()); dma.s6cr.modify(|_, w| w.en().clear_bit());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment