Skip to content

Commit 12bf98d

Browse files
committed
Minor fixes
1 parent 48150f3 commit 12bf98d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/rtic_frame_serial_dma.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ pool!(
3636
#[app(device = stm32l4xx_hal::stm32, peripherals = true)]
3737
const APP: () = {
3838
struct Resources {
39-
rx: serial::Rx<hal::stm32::USART2>,
4039
frame_reader: FrameReader<Box<SerialDMAPool>, RxDma<Rx<USART2>, dma::dma1::C6>, 8>,
4140
frame_sender: FrameSender<Box<SerialDMAPool>, TxDma<Tx<USART2>, dma::dma1::C7>, 8>,
4241
}
@@ -108,7 +107,7 @@ const APP: () = {
108107
/// This task handles the character match interrupt at required by the `FrameReader`
109108
///
110109
/// It will echo the buffer back to the serial.
111-
#[task(binds = USART2, resources = [rx, frame_reader, frame_sender], priority = 3)]
110+
#[task(binds = USART2, resources = [frame_reader, frame_sender], priority = 3)]
112111
fn serial_isr(cx: serial_isr::Context) {
113112
// Check for character match
114113
if cx.resources.frame_reader.check_character_match(true) {
@@ -125,7 +124,7 @@ const APP: () = {
125124
/// This task handles the RX transfer complete interrupt at required by the `FrameReader`
126125
///
127126
/// In this case we are discarding if a frame gets full as no character match was received
128-
#[task(binds = DMA1_CH6, resources = [rx, frame_reader], priority = 3)]
127+
#[task(binds = DMA1_CH6, resources = [frame_reader], priority = 3)]
129128
fn serial_rx_dma_isr(cx: serial_rx_dma_isr::Context) {
130129
if let Some(dma_buf) = SerialDMAPool::alloc() {
131130
let dma_buf = dma_buf.init(DMAFrame::new());

src/dma.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ where
6767

6868
impl<BUFFER, PAYLOAD, CHANNEL, const N: usize> FrameReader<BUFFER, RxDma<PAYLOAD, CHANNEL>, N>
6969
where
70+
BUFFER: Sized + StableDeref<Target = DMAFrame<N>> + DerefMut + 'static,
7071
PAYLOAD: CharacterMatch,
7172
{
7273
/// Checks to see if the peripheral has detected a character match and
@@ -394,7 +395,7 @@ macro_rules! dma {
394395
use core::ptr;
395396
use stable_deref_trait::StableDeref;
396397

397-
use crate::dma::{CircBuffer, FrameReader, CharacterMatch, FrameSender, DMAFrame, DmaExt, Error, Event, Half, Transfer, W, R, RxDma, TxDma, TransferPayload};
398+
use crate::dma::{CircBuffer, FrameReader, FrameSender, DMAFrame, DmaExt, Error, Event, Half, Transfer, W, R, RxDma, TxDma, TransferPayload};
398399
use crate::rcc::AHB1;
399400

400401
#[allow(clippy::manual_non_exhaustive)]

0 commit comments

Comments
 (0)