stm32/dma: minor cleanup, optmization

This commit is contained in:
xoviat 2023-08-04 17:15:56 -05:00
parent 7e269f6f17
commit e80db42061
2 changed files with 6 additions and 6 deletions

View file

@ -497,7 +497,7 @@ impl<'a, C: Channel, W: Word> ReadableRingBuffer<'a, C, W> {
}
/// The capacity of the ringbuffer.
pub fn cap(&self) -> usize {
pub const fn cap(&self) -> usize {
self.ringbuf.cap()
}
@ -628,7 +628,7 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> {
}
/// The capacity of the ringbuffer.
pub fn cap(&self) -> usize {
pub const fn cap(&self) -> usize {
self.ringbuf.cap()
}

View file

@ -742,12 +742,12 @@ impl<'a, C: Channel, W: Word> ReadableRingBuffer<'a, C, W> {
}
// The capacity of the ringbuffer
pub fn cap(&self) -> usize {
pub const fn cap(&self) -> usize {
self.ringbuf.cap()
}
pub fn set_waker(&mut self, waker: &Waker) {
STATE.ch_wakers[self.channel.index()].register(waker);
DmaCtrlImpl(self.channel.reborrow()).set_waker(waker);
}
fn clear_irqs(&mut self) {
@ -890,12 +890,12 @@ impl<'a, C: Channel, W: Word> WritableRingBuffer<'a, C, W> {
}
// The capacity of the ringbuffer
pub fn cap(&self) -> usize {
pub const fn cap(&self) -> usize {
self.ringbuf.cap()
}
pub fn set_waker(&mut self, waker: &Waker) {
STATE.ch_wakers[self.channel.index()].register(waker);
DmaCtrlImpl(self.channel.reborrow()).set_waker(waker);
}
fn clear_irqs(&mut self) {