Skip to content

Commit ac80faf

Browse files
committed
Fix some errors when merging master
1 parent b0a6d54 commit ac80faf

File tree

4 files changed

+8
-60
lines changed

4 files changed

+8
-60
lines changed

Diff for: hal/src/dmac/dma_controller.rs

+2-46
Original file line numberDiff line numberDiff line change
@@ -148,50 +148,6 @@ pub struct RoundRobinMask {
148148
}
149149

150150
impl<T> DmaController<T> {
151-
/// Initialize the DMAC and return a DmaController object useable by
152-
/// [`Transfer`](super::transfer::Transfer)'s. By default, all
153-
/// priority levels are enabled unless subsequently disabled using the
154-
/// `level_x_enabled` methods.
155-
#[inline]
156-
pub fn init(mut dmac: DMAC, _pm: &mut PM) -> Self {
157-
// ----- Initialize clocking ----- //
158-
#[cfg(feature = "thumbv6")]
159-
{
160-
// Enable clocking
161-
_pm.ahbmask.modify(|_, w| w.dmac_().set_bit());
162-
_pm.apbbmask.modify(|_, w| w.dmac_().set_bit());
163-
}
164-
165-
Self::swreset(&mut dmac);
166-
167-
// SAFETY this is safe because we write a whole u32 to 32-bit registers,
168-
// and the descriptor array addesses will never change since they are static.
169-
// We just need to ensure the writeback and descriptor_section addresses
170-
// are valid.
171-
unsafe {
172-
dmac.baseaddr
173-
.write(|w| w.baseaddr().bits(DESCRIPTOR_SECTION.as_ptr() as u32));
174-
dmac.wrbaddr
175-
.write(|w| w.wrbaddr().bits(WRITEBACK.as_ptr() as u32));
176-
}
177-
178-
// ----- Select priority levels ----- //
179-
dmac.ctrl.modify(|_, w| {
180-
w.lvlen3().set_bit();
181-
w.lvlen2().set_bit();
182-
w.lvlen1().set_bit();
183-
w.lvlen0().set_bit()
184-
});
185-
186-
// Enable DMA controller
187-
dmac.ctrl.modify(|_, w| w.dmaenable().set_bit());
188-
189-
Self {
190-
dmac,
191-
_interrupts: NoneT,
192-
}
193-
}
194-
195151
/// Enable multiple priority levels simultaneously
196152
#[inline]
197153
pub fn enable_levels(&mut self, mask: PriorityLevelMask) {
@@ -264,15 +220,15 @@ impl<T> DmaController<T> {
264220
}
265221
}
266222

267-
impl DmaController<NoneT> {
223+
impl DmaController {
268224
/// Initialize the DMAC and return a DmaController object useable by
269225
/// [`Transfer`](super::transfer::Transfer)'s. By default, all
270226
/// priority levels are enabled unless subsequently disabled using the
271227
/// `level_x_enabled` methods.
272228
#[inline]
273229
pub fn init(mut dmac: DMAC, _pm: &mut PM) -> Self {
274230
// ----- Initialize clocking ----- //
275-
#[cfg(any(feature = "samd11", feature = "samd21"))]
231+
#[cfg(feature = "thumbv6")]
276232
{
277233
// Enable clocking
278234
_pm.ahbmask.modify(|_, w| w.dmac_().set_bit());

Diff for: hal/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ pub use async_hal::*;
9090
#[cfg(feature = "async")]
9191
pub use cortex_m_interrupt::{self, take_exception, take_nvic_interrupt};
9292

93-
#[cfg(all(feature = "unproven", feature = "dma"))]
9493
#[cfg(feature = "dma")]
9594
pub mod dmac;
9695

Diff for: hal/src/thumbv6m/eic/pin.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ use crate::{
99
};
1010
use core::mem::ManuallyDrop;
1111

12-
use super::EIC;
13-
1412
/// The EicPin trait makes it more ergonomic to convert a gpio pin into an EIC
1513
/// pin. You should not implement this trait for yourself; only the
1614
/// implementations in the EIC module make sense.
@@ -158,10 +156,6 @@ crate::paste::item! {
158156
}
159157
});
160158
}
161-
162-
fn id(&self) -> ExternalInterruptID {
163-
$num
164-
}
165159
}
166160

167161
#[cfg(feature = "async")]
@@ -324,6 +318,9 @@ crate::paste::item! {
324318

325319
// SAMD11
326320

321+
#[cfg(feature = "samd11")]
322+
pub const NUM_CHANNELS: usize = 8;
323+
327324
#[cfg(feature = "samd11")]
328325
mod impls {
329326
use super::*;
@@ -359,11 +356,11 @@ mod impls {
359356
});
360357
}
361358

362-
#[cfg(feature = "samd11")]
363-
pub const NUM_CHANNELS: usize = 8;
364-
365359
// SAMD21
366360

361+
#[cfg(feature = "samd21")]
362+
pub const NUM_CHANNELS: usize = 16;
363+
367364
#[cfg(feature = "samd21")]
368365
mod impls {
369366
use super::*;

Diff for: hal/src/thumbv7em/eic/pin.rs

-4
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ crate::paste::item! {
169169
});
170170
}
171171

172-
fn id(&self) -> ExternalInterruptID {
173-
$num
174-
}
175-
176172
/// Turn an EIC pin into a pin usable as a [`Future`](core::future::Future).
177173
/// The correct interrupt source is needed.
178174
#[cfg(feature = "async")]

0 commit comments

Comments
 (0)