Fix warnings for embassy-stm32 and embassy-stm32-examples
This commit is contained in:
21
embassy-stm32-examples/.cargo/config.toml
Normal file
21
embassy-stm32-examples/.cargo/config.toml
Normal file
@ -0,0 +1,21 @@
|
||||
[unstable]
|
||||
build-std = ["core"]
|
||||
|
||||
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
|
||||
# replace STM32F429ZITx with your chip as listed in `probe-run --list-chips`
|
||||
runner = "probe-run --chip STM32F429ZITx"
|
||||
|
||||
rustflags = [
|
||||
# LLD (shipped with the Rust toolchain) is used as the default linker
|
||||
"-C", "link-arg=--nmagic",
|
||||
"-C", "link-arg=-Tlink.x",
|
||||
"-C", "link-arg=-Tdefmt.x",
|
||||
|
||||
# Code-size optimizations.
|
||||
"-Z", "trap-unreachable=no",
|
||||
"-C", "inline-threshold=5",
|
||||
"-C", "no-vectorize-loops",
|
||||
]
|
||||
|
||||
[build]
|
||||
target = "thumbv7em-none-eabi"
|
7
embassy-stm32-examples/memory.x
Normal file
7
embassy-stm32-examples/memory.x
Normal file
@ -0,0 +1,7 @@
|
||||
MEMORY
|
||||
{
|
||||
/* NOTE 1 K = 1 KiBi = 1024 bytes */
|
||||
/* These values correspond to the STM32F429ZI */
|
||||
FLASH : ORIGIN = 0x08000000, LENGTH = 1024K
|
||||
RAM : ORIGIN = 0x20000000, LENGTH = 256K
|
||||
}
|
@ -4,6 +4,7 @@
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
#[path = "../example_common.rs"]
|
||||
mod example_common;
|
||||
|
@ -4,6 +4,7 @@
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
#[path = "../example_common.rs"]
|
||||
mod example_common;
|
||||
|
@ -4,13 +4,14 @@
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
#[path = "../example_common.rs"]
|
||||
mod example_common;
|
||||
use embassy::executor::Executor;
|
||||
use embassy::time::Clock;
|
||||
use embassy::util::Forever;
|
||||
use embassy_stm32::exti::{self, ExtiInput};
|
||||
use embassy_stm32::exti::ExtiInput;
|
||||
use embassy_stm32::gpio::{Input, Pull};
|
||||
use embassy_traits::gpio::{WaitForFallingEdge, WaitForRisingEdge};
|
||||
use example_common::*;
|
||||
|
@ -4,20 +4,20 @@
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
#[path = "../example_common.rs"]
|
||||
mod example_common;
|
||||
|
||||
use embassy_stm32::gpio::{Input, Level, Output, Pull};
|
||||
use embedded_hal::digital::v2::{InputPin, OutputPin};
|
||||
use embassy_stm32::gpio::{Level, Output};
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
use example_common::*;
|
||||
|
||||
use cortex_m_rt::entry;
|
||||
use stm32f4::stm32f429 as pac;
|
||||
//use stm32l4::stm32l4x5 as pac;
|
||||
use embassy_stm32::spi::{ByteOrder, Config, Spi, MODE_0};
|
||||
use embassy_stm32::spi::{Config, Spi};
|
||||
use embassy_stm32::time::Hertz;
|
||||
use embedded_hal::blocking::spi::Transfer;
|
||||
use stm32f4::stm32f429 as pac;
|
||||
|
||||
#[entry]
|
||||
fn main() -> ! {
|
||||
@ -47,7 +47,6 @@ fn main() -> ! {
|
||||
w
|
||||
});
|
||||
|
||||
let rc = pp.RCC.cfgr.read().sws().bits();
|
||||
let p = embassy_stm32::init(Default::default());
|
||||
|
||||
let mut spi = Spi::new(
|
||||
@ -64,9 +63,9 @@ fn main() -> ! {
|
||||
|
||||
loop {
|
||||
let mut buf = [0x0A; 4];
|
||||
cs.set_low();
|
||||
spi.transfer(&mut buf);
|
||||
cs.set_high();
|
||||
unwrap!(cs.set_low());
|
||||
unwrap!(spi.transfer(&mut buf));
|
||||
unwrap!(cs.set_high());
|
||||
info!("xfer {=[u8]:x}", buf);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
#[path = "../example_common.rs"]
|
||||
mod example_common;
|
||||
@ -11,7 +12,6 @@ use cortex_m::prelude::_embedded_hal_blocking_serial_Write;
|
||||
use embassy::executor::Executor;
|
||||
use embassy::time::Clock;
|
||||
use embassy::util::Forever;
|
||||
use embassy_stm32::gpio::NoPin;
|
||||
use embassy_stm32::usart::{Config, Uart};
|
||||
use example_common::*;
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
#[path = "../example_common.rs"]
|
||||
mod example_common;
|
||||
|
Reference in New Issue
Block a user