cleanup misc. warnings

This commit is contained in:
xoviat 2021-03-17 21:21:48 -05:00
parent 4a38e7eb2b
commit b204c0974c
5 changed files with 7 additions and 15 deletions

View File

@ -14,13 +14,11 @@ use cortex_m_rt::entry;
use embassy::executor::{task, Executor}; use embassy::executor::{task, Executor};
use embassy::traits::gpio::*; use embassy::traits::gpio::*;
use embassy::util::Forever; use embassy::util::Forever;
use embassy_stm32f4::{can, exti, interrupt}; use embassy_stm32f4::{can, interrupt};
use futures::pin_mut; use futures::pin_mut;
use stm32f4xx_hal::prelude::*; use stm32f4xx_hal::prelude::*;
use stm32f4xx_hal::{can::Can, stm32}; use stm32f4xx_hal::{can::Can, stm32};
static EXTI: Forever<exti::ExtiManager> = Forever::new();
#[task] #[task]
async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
let gpioa = dp.GPIOA.split(); let gpioa = dp.GPIOA.split();

View File

@ -9,11 +9,9 @@ use bxcan::Interrupts;
use core::future::Future; use core::future::Future;
use embassy::interrupt::Interrupt; use embassy::interrupt::Interrupt;
use embassy::util::InterruptFuture; use embassy::util::InterruptFuture;
use embassy::util::Signal;
use nb; use nb;
use nb::block; use nb::block;
use crate::hal::prelude::*;
use crate::interrupt; use crate::interrupt;
/// Interface to the Serial peripheral /// Interface to the Serial peripheral
@ -53,9 +51,9 @@ impl<T: Instance> Can<T> {
/// Receive can frame. /// Receive can frame.
/// ///
/// This method async-blocks until the frame is received. /// This method async-blocks until the frame is received.
pub fn receive<'a>(&'a mut self) -> impl Future<Output = (bxcan::Frame)> + 'a { pub fn receive<'a>(&'a mut self) -> impl Future<Output = bxcan::Frame> + 'a {
async move { async move {
let mut frame: Option<bxcan::Frame> = None; let mut frame: Option<bxcan::Frame>;
loop { loop {
let fut = InterruptFuture::new(&mut self.rx_int); let fut = InterruptFuture::new(&mut self.rx_int);

View File

@ -2,7 +2,6 @@ use core::future::Future;
use core::mem; use core::mem;
use core::pin::Pin; use core::pin::Pin;
use embassy::interrupt::Interrupt;
use embassy::traits::gpio::{WaitForFallingEdge, WaitForRisingEdge}; use embassy::traits::gpio::{WaitForFallingEdge, WaitForRisingEdge};
use embassy::util::InterruptFuture; use embassy::util::InterruptFuture;

View File

@ -1,21 +1,19 @@
use crate::interrupt; use crate::interrupt;
use core::future::Future; use core::future::Future;
use core::pin::Pin; use core::pin::Pin;
use embassy::interrupt::Interrupt;
use embassy::traits::qei::WaitForRotate; use embassy::traits::qei::WaitForRotate;
use embedded_hal::Direction; use embedded_hal::Direction;
use embedded_hal::Qei as THQei;
use stm32f4xx_hal::pac::TIM2; use stm32f4xx_hal::pac::TIM2;
use stm32f4xx_hal::qei::{Pins, Qei as HalQei}; use stm32f4xx_hal::{qei, qei::Pins};
pub struct Qei<T: Instance, PINS> { pub struct Qei<T: Instance, PINS> {
qei: HalQei<T, PINS>, qei: qei::Qei<T, PINS>,
int: T::Interrupt, int: T::Interrupt,
} }
impl<PINS: Pins<TIM2>> Qei<TIM2, PINS> { impl<PINS: Pins<TIM2>> Qei<TIM2, PINS> {
pub fn tim2(tim: TIM2, pins: PINS, interrupt: interrupt::TIM2) -> Self { pub fn tim2(tim: TIM2, pins: PINS, interrupt: interrupt::TIM2) -> Self {
let qei = HalQei::tim2(tim, pins); let qei = qei::Qei::tim2(tim, pins);
let tim = unsafe { let tim = unsafe {
&mut *(stm32f4xx_hal::stm32::TIM2::ptr() &mut *(stm32f4xx_hal::stm32::TIM2::ptr()

View File

@ -6,10 +6,9 @@
use core::future::Future; use core::future::Future;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::ptr;
use core::sync::atomic::{self, Ordering}; use core::sync::atomic::{self, Ordering};
use embassy::interrupt::{Interrupt, InterruptExt}; use embassy::interrupt::Interrupt;
use embassy::traits::uart::{Error, Uart}; use embassy::traits::uart::{Error, Uart};
use embassy::util::InterruptFuture; use embassy::util::InterruptFuture;