Merge pull request #197 from rukai/fix_stm32_warnings

Fix warnings for embassy-stm32 and embassy-stm32-examples and add .cargo/config.toml + memory.x
This commit is contained in:
Dario Nieuwenhuis
2021-05-21 17:25:59 +02:00
committed by GitHub
18 changed files with 49 additions and 23 deletions

View File

@ -3,6 +3,7 @@
#[cfg_attr(feature = "_dma_v1", path = "v1.rs")]
#[cfg_attr(feature = "_dma_v2", path = "v2.rs")]
mod _version;
#[allow(unused)]
pub use _version::*;
use crate::pac;

View File

@ -5,7 +5,7 @@ use embassy::util::AtomicWaker;
use futures::future::poll_fn;
use super::*;
use crate::fmt::{assert, *};
use crate::fmt::assert;
use crate::interrupt;
use crate::pac;
use crate::pac::dma::{regs, vals};

View File

@ -11,7 +11,6 @@ use embassy_extras::unsafe_impl_unborrow;
use embedded_hal::digital::v2::InputPin;
use pac::exti::{regs, vals};
use crate::fmt::*;
use crate::gpio::{AnyPin, Input, Pin as GpioPin};
use crate::interrupt;
use crate::pac;

View File

@ -9,8 +9,6 @@
// This must go FIRST so that all the other modules see its macros.
pub mod fmt;
use embassy::interrupt::{Interrupt, InterruptExt};
#[cfg(feature = "_dma")]
pub mod dma;
pub mod exti;

View File

@ -1,4 +1,3 @@
#![no_std]
#![doc = "Peripheral access API (generated using svd2rust v0.17.0 (22741fa 2021-04-20))"]
pub mod syscfg_l4 {
use crate::generic::*;

View File

@ -8,7 +8,6 @@ use embassy_extras::unborrow;
use futures::future::poll_fn;
use rand_core::{CryptoRng, RngCore};
use crate::fmt::*;
use crate::pac;
pub(crate) static RNG_WAKER: AtomicWaker = AtomicWaker::new();

View File

@ -8,6 +8,7 @@ pub use _version::*;
use crate::gpio::Pin;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error {
Framing,
Crc,

View File

@ -20,7 +20,6 @@ impl WordSize {
}
pub struct Spi<'d, T: Instance> {
//peri: T,
sck: AnyPin,
mosi: AnyPin,
miso: AnyPin,
@ -31,7 +30,7 @@ pub struct Spi<'d, T: Instance> {
impl<'d, T: Instance> Spi<'d, T> {
pub fn new<F>(
pclk: Hertz,
peri: impl Unborrow<Target = T> + 'd,
_peri: impl Unborrow<Target = T> + 'd,
sck: impl Unborrow<Target = impl SckPin<T>>,
mosi: impl Unborrow<Target = impl MosiPin<T>>,
miso: impl Unborrow<Target = impl MisoPin<T>>,
@ -41,7 +40,7 @@ impl<'d, T: Instance> Spi<'d, T> {
where
F: Into<Hertz>,
{
unborrow!(peri, sck, mosi, miso);
unborrow!(sck, mosi, miso);
unsafe {
sck.set_as_af(sck.af_num());
@ -90,7 +89,6 @@ impl<'d, T: Instance> Spi<'d, T> {
}
Self {
//peri,
sck,
mosi,
miso,

View File

@ -3,8 +3,7 @@ use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use crate::gpio::{NoPin, Pin};
use crate::pac::usart::{regs, vals, Usart};
use crate::pac::usart::{regs, vals};
use super::*;