Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
korken89 committed May 23, 2021
1 parent d84549f commit bc42e92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions examples/rtic_frame_serial_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ pool!(
#[app(device = stm32l4xx_hal::stm32, peripherals = true)]
const APP: () = {
struct Resources {
rx: serial::Rx<hal::stm32::USART2>,
frame_reader: FrameReader<Box<SerialDMAPool>, RxDma<Rx<USART2>, dma::dma1::C6>, 8>,
frame_sender: FrameSender<Box<SerialDMAPool>, TxDma<Tx<USART2>, dma::dma1::C7>, 8>,
}
Expand Down Expand Up @@ -108,7 +107,7 @@ const APP: () = {
/// This task handles the character match interrupt at required by the `FrameReader`
///
/// It will echo the buffer back to the serial.
#[task(binds = USART2, resources = [rx, frame_reader, frame_sender], priority = 3)]
#[task(binds = USART2, resources = [frame_reader, frame_sender], priority = 3)]
fn serial_isr(cx: serial_isr::Context) {
// Check for character match
if cx.resources.frame_reader.check_character_match(true) {
Expand All @@ -125,7 +124,7 @@ const APP: () = {
/// This task handles the RX transfer complete interrupt at required by the `FrameReader`
///
/// In this case we are discarding if a frame gets full as no character match was received
#[task(binds = DMA1_CH6, resources = [rx, frame_reader], priority = 3)]
#[task(binds = DMA1_CH6, resources = [frame_reader], priority = 3)]
fn serial_rx_dma_isr(cx: serial_rx_dma_isr::Context) {
if let Some(dma_buf) = SerialDMAPool::alloc() {
let dma_buf = dma_buf.init(DMAFrame::new());
Expand Down
3 changes: 2 additions & 1 deletion src/dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ where

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

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

#[allow(clippy::manual_non_exhaustive)]
Expand Down

0 comments on commit bc42e92

Please sign in to comment.