Use embassy/defmt-timestamp-uptime in all examples.
This commit is contained in:
parent
a9e63167e1
commit
82803bffda
@ -9,7 +9,7 @@ default = ["nightly"]
|
|||||||
nightly = ["embassy-nrf/nightly", "embassy-nrf/unstable-traits"]
|
nightly = ["embassy-nrf/nightly", "embassy-nrf/unstable-traits"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] }
|
embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] }
|
||||||
|
|
||||||
defmt = "0.3"
|
defmt = "0.3"
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::info;
|
||||||
mod example_common;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::interrupt;
|
use embassy_nrf::interrupt;
|
||||||
use embassy_nrf::timer::Timer;
|
use embassy_nrf::timer::Timer;
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
use example_common::info;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
|
let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
|
||||||
|
@ -2,16 +2,16 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::io::{AsyncBufReadExt, AsyncWriteExt};
|
use embassy::io::{AsyncBufReadExt, AsyncWriteExt};
|
||||||
use embassy_nrf::buffered_uarte::State;
|
use embassy_nrf::buffered_uarte::State;
|
||||||
use embassy_nrf::{buffered_uarte::BufferedUarte, interrupt, uarte, Peripherals};
|
use embassy_nrf::{buffered_uarte::BufferedUarte, interrupt, uarte, Peripherals};
|
||||||
use example_common::*;
|
|
||||||
use futures::pin_mut;
|
use futures::pin_mut;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut config = uarte::Config::default();
|
let mut config = uarte::Config::default();
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use core::task::Poll;
|
use core::task::Poll;
|
||||||
|
use defmt::{info, unwrap};
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Instant, Timer};
|
use embassy::time::{Duration, Instant, Timer};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::task]
|
#[embassy::task]
|
||||||
async fn run1() {
|
async fn run1() {
|
||||||
loop {
|
loop {
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::info;
|
||||||
mod example_common;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::gpio::{Input, Pull};
|
use embassy_nrf::gpio::{Input, Pull};
|
||||||
use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity};
|
use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
info!("Starting!");
|
info!("Starting!");
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::{info, unwrap};
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull};
|
use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::task(pool_size = 4)]
|
#[embassy::task(pool_size = 4)]
|
||||||
async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) {
|
async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) {
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use defmt::unwrap;
|
use defmt::unwrap;
|
||||||
use embassy::blocking_mutex::raw::NoopRawMutex;
|
use embassy::blocking_mutex::raw::NoopRawMutex;
|
||||||
use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError};
|
use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError};
|
||||||
@ -14,6 +11,9 @@ use embassy::util::Forever;
|
|||||||
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
enum LedState {
|
enum LedState {
|
||||||
On,
|
On,
|
||||||
Off,
|
Off,
|
||||||
|
@ -57,17 +57,17 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::{info, unwrap};
|
||||||
use embassy::executor::{Executor, InterruptExecutor};
|
use embassy::executor::{Executor, InterruptExecutor};
|
||||||
use embassy::interrupt::InterruptExt;
|
use embassy::interrupt::InterruptExt;
|
||||||
use embassy::time::{Duration, Instant, Timer};
|
use embassy::time::{Duration, Instant, Timer};
|
||||||
use embassy::util::Forever;
|
use embassy::util::Forever;
|
||||||
use embassy_nrf::interrupt;
|
use embassy_nrf::interrupt;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::task]
|
#[embassy::task]
|
||||||
async fn run_high() {
|
async fn run_high() {
|
||||||
loop {
|
loop {
|
||||||
|
@ -2,14 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::{info, unwrap};
|
||||||
mod example_common;
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_nrf::nvmc::Nvmc;
|
use embassy_nrf::nvmc::Nvmc;
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
|
use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,11 +2,8 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use core::future::pending;
|
use core::future::pending;
|
||||||
|
use defmt::info;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull};
|
use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull};
|
||||||
use embassy_nrf::gpiote::{self, InputChannel, InputChannelPolarity};
|
use embassy_nrf::gpiote::{self, InputChannel, InputChannelPolarity};
|
||||||
@ -14,6 +11,9 @@ use embassy_nrf::ppi::Ppi;
|
|||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
use gpiote::{OutputChannel, OutputChannelPolarity};
|
use gpiote::{OutputChannel, OutputChannelPolarity};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
info!("Starting!");
|
info!("Starting!");
|
||||||
|
@ -2,14 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_nrf::pwm::{Prescaler, SimplePwm};
|
use embassy_nrf::pwm::{Prescaler, SimplePwm};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
// for i in range(1024): print(int((math.sin(i/512*math.pi)*0.4+0.5)**2*32767), ', ', end='')
|
// for i in range(1024): print(int((math.sin(i/512*math.pi)*0.4+0.5)**2*32767), ', ', end='')
|
||||||
static DUTY: [u16; 1024] = [
|
static DUTY: [u16; 1024] = [
|
||||||
8191, 8272, 8353, 8434, 8516, 8598, 8681, 8764, 8847, 8931, 9015, 9099, 9184, 9269, 9354, 9440,
|
8191, 8272, 8353, 8434, 8516, 8598, 8681, 8764, 8847, 8931, 9015, 9099, 9184, 9269, 9354, 9440,
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
@ -13,6 +11,9 @@ use embassy_nrf::pwm::{
|
|||||||
};
|
};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let seq_words_0: [u16; 5] = [1000, 250, 100, 50, 0];
|
let seq_words_0: [u16; 5] = [1000, 250, 100, 50, 0];
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
@ -12,6 +10,9 @@ use embassy_nrf::pwm::{
|
|||||||
};
|
};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let seq_words: [u16; 5] = [1000, 250, 100, 50, 0];
|
let seq_words: [u16; 5] = [1000, 250, 100, 50, 0];
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
#![feature(array_from_fn)]
|
#![feature(array_from_fn)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use core::future::pending;
|
use core::future::pending;
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
@ -16,6 +14,9 @@ use embassy_nrf::pwm::{
|
|||||||
};
|
};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let seq_words: [u16; 5] = [1000, 250, 100, 50, 0];
|
let seq_words: [u16; 5] = [1000, 250, 100, 50, 0];
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
@ -13,6 +11,9 @@ use embassy_nrf::pwm::{
|
|||||||
};
|
};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
// WS2812B LED light demonstration. Drives just one light.
|
// WS2812B LED light demonstration. Drives just one light.
|
||||||
// The following reference on WS2812B may be of use:
|
// The following reference on WS2812B may be of use:
|
||||||
// https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf.
|
// https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf.
|
||||||
|
@ -2,14 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_nrf::pwm::{Prescaler, SimplePwm};
|
use embassy_nrf::pwm::{Prescaler, SimplePwm};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut pwm = SimplePwm::new_1ch(p.PWM0, p.P0_05);
|
let mut pwm = SimplePwm::new_1ch(p.PWM0, p.P0_05);
|
||||||
|
@ -2,14 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::{assert_eq, info, unwrap};
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use defmt::assert_eq;
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
use embassy_nrf::{interrupt, qspi};
|
use embassy_nrf::{interrupt, qspi};
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
const PAGE_SIZE: usize = 4096;
|
const PAGE_SIZE: usize = 4096;
|
||||||
|
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use core::mem;
|
use core::mem;
|
||||||
|
use defmt::{info, unwrap};
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
use embassy_nrf::{interrupt, qspi};
|
use embassy_nrf::{interrupt, qspi};
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
// Workaround for alignment requirements.
|
// Workaround for alignment requirements.
|
||||||
// Nicer API will probably come in the future.
|
// Nicer API will probably come in the future.
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use core::mem;
|
use core::mem;
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::{info, unwrap};
|
||||||
use embassy::executor::raw::TaskStorage;
|
use embassy::executor::raw::TaskStorage;
|
||||||
use embassy::executor::Executor;
|
use embassy::executor::Executor;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy::util::Forever;
|
use embassy::util::Forever;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
async fn run1() {
|
async fn run1() {
|
||||||
loop {
|
loop {
|
||||||
info!("BIG INFREQUENT TICK");
|
info!("BIG INFREQUENT TICK");
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::interrupt;
|
use embassy_nrf::interrupt;
|
||||||
use embassy_nrf::rng::Rng;
|
use embassy_nrf::rng::Rng;
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
use rand::Rng as _;
|
use rand::Rng as _;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut rng = Rng::new(p.RNG, interrupt::take!(RNG));
|
let mut rng = Rng::new(p.RNG, interrupt::take!(RNG));
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::info;
|
||||||
mod example_common;
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_nrf::saadc::{ChannelConfig, Config, Saadc};
|
use embassy_nrf::saadc::{ChannelConfig, Config, Saadc};
|
||||||
use embassy_nrf::{interrupt, Peripherals};
|
use embassy_nrf::{interrupt, Peripherals};
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, mut p: Peripherals) {
|
async fn main(_spawner: Spawner, mut p: Peripherals) {
|
||||||
|
@ -2,14 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::info;
|
||||||
mod example_common;
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::Duration;
|
use embassy::time::Duration;
|
||||||
use embassy_nrf::saadc::{ChannelConfig, Config, Saadc, SamplerState};
|
use embassy_nrf::saadc::{ChannelConfig, Config, Saadc, SamplerState};
|
||||||
use embassy_nrf::timer::Frequency;
|
use embassy_nrf::timer::Frequency;
|
||||||
use embassy_nrf::{interrupt, Peripherals};
|
use embassy_nrf::{interrupt, Peripherals};
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
// Demonstrates both continuous sampling and scanning multiple channels driven by a PPI linked timer
|
// Demonstrates both continuous sampling and scanning multiple channels driven by a PPI linked timer
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::{info, unwrap};
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
use embassy_nrf::gpio::{Level, Output, OutputDrive};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
use embassy_nrf::{interrupt, spim};
|
use embassy_nrf::{interrupt, spim};
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,16 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::info;
|
||||||
mod example_common;
|
use embassy::executor::Spawner;
|
||||||
use example_common::*;
|
use embassy::time::{Duration, Timer};
|
||||||
|
|
||||||
use embassy::{
|
|
||||||
executor::Spawner,
|
|
||||||
time::{Duration, Timer},
|
|
||||||
};
|
|
||||||
use embassy_nrf::{interrupt, temp::Temp, Peripherals};
|
use embassy_nrf::{interrupt, temp::Temp, Peripherals};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let irq = interrupt::take!(TEMP);
|
let irq = interrupt::take!(TEMP);
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::{info, unwrap};
|
||||||
mod example_common;
|
|
||||||
use embassy_nrf::Peripherals;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::task]
|
#[embassy::task]
|
||||||
async fn run1() {
|
async fn run1() {
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::twim::{self, Twim};
|
use embassy_nrf::twim::{self, Twim};
|
||||||
use embassy_nrf::{interrupt, Peripherals};
|
use embassy_nrf::{interrupt, Peripherals};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
const ADDRESS: u8 = 0x50;
|
const ADDRESS: u8 = 0x50;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
|
@ -8,17 +8,16 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use core::mem;
|
use core::mem;
|
||||||
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_nrf::twim::{self, Twim};
|
use embassy_nrf::twim::{self, Twim};
|
||||||
use embassy_nrf::{interrupt, Peripherals};
|
use embassy_nrf::{interrupt, Peripherals};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
const ADDRESS: u8 = 0x50;
|
const ADDRESS: u8 = 0x50;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::{interrupt, uarte, Peripherals};
|
use embassy_nrf::{interrupt, uarte, Peripherals};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut config = uarte::Config::default();
|
let mut config = uarte::Config::default();
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::{interrupt, uarte, Peripherals};
|
use embassy_nrf::{interrupt, uarte, Peripherals};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut config = uarte::Config::default();
|
let mut config = uarte::Config::default();
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
use embassy::blocking_mutex::raw::NoopRawMutex;
|
use embassy::blocking_mutex::raw::NoopRawMutex;
|
||||||
use embassy::channel::mpsc::{self, Channel, Sender};
|
use embassy::channel::mpsc::{self, Channel, Sender};
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
@ -14,6 +11,9 @@ use embassy_nrf::peripherals::UARTE0;
|
|||||||
use embassy_nrf::uarte::UarteRx;
|
use embassy_nrf::uarte::UarteRx;
|
||||||
use embassy_nrf::{interrupt, uarte, Peripherals};
|
use embassy_nrf::{interrupt, uarte, Peripherals};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
static CHANNEL: Forever<Channel<NoopRawMutex, [u8; 8], 1>> = Forever::new();
|
static CHANNEL: Forever<Channel<NoopRawMutex, [u8; 8], 1>> = Forever::new();
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
|
@ -2,21 +2,18 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use defmt::{info, unwrap};
|
use defmt::{info, unwrap};
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use embassy::interrupt::InterruptExt;
|
|
||||||
use futures::pin_mut;
|
|
||||||
use panic_probe as _; // print out panic messages
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
|
use embassy::interrupt::InterruptExt;
|
||||||
use embassy::io::{AsyncBufReadExt, AsyncWriteExt};
|
use embassy::io::{AsyncBufReadExt, AsyncWriteExt};
|
||||||
use embassy_nrf::usb::{State, Usb, UsbBus, UsbSerial};
|
use embassy_nrf::usb::{State, Usb, UsbBus, UsbSerial};
|
||||||
use embassy_nrf::{interrupt, Peripherals};
|
use embassy_nrf::{interrupt, Peripherals};
|
||||||
|
use futures::pin_mut;
|
||||||
use usb_device::device::{UsbDeviceBuilder, UsbVidPid};
|
use usb_device::device::{UsbDeviceBuilder, UsbVidPid};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _; // print out panic messages
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut rx_buffer = [0u8; 64];
|
let mut rx_buffer = [0u8; 64];
|
||||||
|
@ -2,13 +2,7 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use defmt::{info, unwrap};
|
use defmt::{info, unwrap};
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _; // print out panic messages
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::interrupt::InterruptExt;
|
use embassy::interrupt::InterruptExt;
|
||||||
use embassy::io::{read_line, AsyncWriteExt};
|
use embassy::io::{read_line, AsyncWriteExt};
|
||||||
@ -17,6 +11,9 @@ use embassy_nrf::{interrupt, Peripherals};
|
|||||||
use futures::pin_mut;
|
use futures::pin_mut;
|
||||||
use usb_device::device::{UsbDeviceBuilder, UsbVidPid};
|
use usb_device::device::{UsbDeviceBuilder, UsbVidPid};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _; // print out panic messages
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut rx_buffer = [0u8; 64];
|
let mut rx_buffer = [0u8; 64];
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_nrf::gpio::{Input, Pull};
|
use embassy_nrf::gpio::{Input, Pull};
|
||||||
use embassy_nrf::wdt::{Config, Watchdog};
|
use embassy_nrf::wdt::{Config, Watchdog};
|
||||||
use embassy_nrf::Peripherals;
|
use embassy_nrf::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
info!("Hello World!");
|
info!("Hello World!");
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {"{=u64}", {
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ version = "0.1.0"
|
|||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] }
|
embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] }
|
||||||
atomic-polyfill = "0.1.5"
|
atomic-polyfill = "0.1.5"
|
||||||
|
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_rp::{gpio, Peripherals};
|
use embassy_rp::{gpio, Peripherals};
|
||||||
use gpio::{Level, Output};
|
use gpio::{Level, Output};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let mut led = Output::new(p.PIN_25, Level::Low);
|
let mut led = Output::new(p.PIN_25, Level::Low);
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_rp::gpio::{Input, Level, Output, Pull};
|
use embassy_rp::gpio::{Input, Level, Output, Pull};
|
||||||
use embassy_rp::Peripherals;
|
use embassy_rp::Peripherals;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let button = Input::new(p.PIN_28, Pull::Up);
|
let button = Input::new(p.PIN_28, Pull::Up);
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_rp::spi;
|
use embassy_rp::spi;
|
||||||
@ -12,6 +9,9 @@ use embassy_rp::spi::Spi;
|
|||||||
use embassy_rp::{gpio, Peripherals};
|
use embassy_rp::{gpio, Peripherals};
|
||||||
use gpio::{Level, Output};
|
use gpio::{Level, Output};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
info!("Hello World!");
|
info!("Hello World!");
|
||||||
|
@ -2,11 +2,7 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
|
|
||||||
use defmt::*;
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::Delay;
|
use embassy::time::Delay;
|
||||||
@ -27,6 +23,9 @@ use crate::my_display_interface::SPIDeviceInterface;
|
|||||||
use crate::shared_spi::SpiDeviceWithCs;
|
use crate::shared_spi::SpiDeviceWithCs;
|
||||||
use crate::touch::Touch;
|
use crate::touch::Touch;
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
//const DISPLAY_FREQ: u32 = 64_000_000;
|
//const DISPLAY_FREQ: u32 = 64_000_000;
|
||||||
const TOUCH_FREQ: u32 = 200_000;
|
const TOUCH_FREQ: u32 = 200_000;
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_rp::{uart, Peripherals};
|
use embassy_rp::{uart, Peripherals};
|
||||||
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let config = uart::Config::default();
|
let config = uart::Config::default();
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
use defmt_rtt as _;
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
defmt::timestamp! {"{=u64}", {
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,6 +13,6 @@ cortex-m-rt = "0.7.0"
|
|||||||
defmt = "0.3"
|
defmt = "0.3"
|
||||||
defmt-rtt = "0.3"
|
defmt-rtt = "0.3"
|
||||||
panic-probe = "0.3"
|
panic-probe = "0.3"
|
||||||
embassy = { path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-stm32 = { path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f030f4", "time-driver-any"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f030f4", "time-driver-any"] }
|
||||||
|
|
||||||
|
@ -3,13 +3,12 @@
|
|||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
use defmt::info;
|
use defmt::info;
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
|
async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {"{=u64}", {
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ version = "0.1.0"
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] }
|
||||||
|
|
||||||
defmt = "0.3"
|
defmt = "0.3"
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Delay, Duration, Timer};
|
use embassy::time::{Delay, Duration, Timer};
|
||||||
use embassy_stm32::adc::Adc;
|
use embassy_stm32::adc::Adc;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -9,8 +9,8 @@ use embassy_stm32::time::Hertz;
|
|||||||
use embassy_stm32::Config;
|
use embassy_stm32::Config;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
fn config() -> Config {
|
fn config() -> Config {
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {"{=u64}", {
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ version = "0.1.0"
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
||||||
|
|
||||||
defmt = "0.3"
|
defmt = "0.3"
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {
|
|
||||||
"{=u64}",
|
|
||||||
{
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ version = "0.1.0"
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303vc", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303vc", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
|
||||||
|
|
||||||
defmt = "0.3"
|
defmt = "0.3"
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
|
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
|
||||||
use embassy::blocking_mutex::raw::NoopRawMutex;
|
use embassy::blocking_mutex::raw::NoopRawMutex;
|
||||||
use embassy::channel::mpsc::{self, Channel, Receiver, Sender};
|
use embassy::channel::mpsc::{self, Channel, Receiver, Sender};
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
@ -21,7 +20,9 @@ use embassy_stm32::exti::ExtiInput;
|
|||||||
use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed};
|
use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed};
|
||||||
use embassy_stm32::peripherals::PA0;
|
use embassy_stm32::peripherals::PA0;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
struct Leds<'a> {
|
struct Leds<'a> {
|
||||||
leds: [Output<'a, AnyPin>; 8],
|
leds: [Output<'a, AnyPin>; 8],
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::exti::ExtiInput;
|
use embassy_stm32::exti::ExtiInput;
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -9,8 +9,8 @@ use embassy_stm32::time::Hertz;
|
|||||||
use embassy_stm32::Config;
|
use embassy_stm32::Config;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
fn config() -> Config {
|
fn config() -> Config {
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
|
@ -57,9 +57,9 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embassy::executor::{Executor, InterruptExecutor};
|
use embassy::executor::{Executor, InterruptExecutor};
|
||||||
|
@ -2,16 +2,16 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
use core::str::from_utf8;
|
use core::str::from_utf8;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::spi::{Config, Spi};
|
use embassy_stm32::spi::{Config, Spi};
|
||||||
use embassy_stm32::time::Hertz;
|
use embassy_stm32::time::Hertz;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
use heapless::String;
|
use heapless::String;
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::dma::NoDma;
|
use embassy_stm32::dma::NoDma;
|
||||||
use embassy_stm32::usart::{Config, Uart};
|
use embassy_stm32::usart::{Config, Uart};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
use heapless::String;
|
use heapless::String;
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {
|
|
||||||
"{=u64}",
|
|
||||||
{
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,7 +7,7 @@ resolver = "2"
|
|||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "unstable-traits"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "usb-otg"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "usb-otg"] }
|
||||||
|
|
||||||
defmt = "0.3"
|
defmt = "0.3"
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Delay, Duration, Timer};
|
use embassy::time::{Delay, Duration, Timer};
|
||||||
use embassy_stm32::adc::Adc;
|
use embassy_stm32::adc::Adc;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::exti::ExtiInput;
|
use embassy_stm32::exti::ExtiInput;
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::*;
|
||||||
use embassy_stm32::can::bxcan::filter::Mask32;
|
use embassy_stm32::can::bxcan::filter::Mask32;
|
||||||
use embassy_stm32::can::bxcan::{Frame, StandardId};
|
use embassy_stm32::can::bxcan::{Frame, StandardId};
|
||||||
use embassy_stm32::can::Can;
|
use embassy_stm32::can::Can;
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
@ -9,8 +9,8 @@ use embassy_stm32::time::Hertz;
|
|||||||
use embassy_stm32::Config;
|
use embassy_stm32::Config;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
fn config() -> Config {
|
fn config() -> Config {
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
|
@ -57,9 +57,9 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embassy::executor::{Executor, InterruptExecutor};
|
use embassy::executor::{Executor, InterruptExecutor};
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::sdmmc::Sdmmc;
|
use embassy_stm32::sdmmc::Sdmmc;
|
||||||
use embassy_stm32::time::U32Ext;
|
use embassy_stm32::time::U32Ext;
|
||||||
use embassy_stm32::{interrupt, Config, Peripherals};
|
use embassy_stm32::{interrupt, Config, Peripherals};
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
fn config() -> Config {
|
fn config() -> Config {
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::*;
|
||||||
use embassy_stm32::dma::NoDma;
|
use embassy_stm32::dma::NoDma;
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::spi::{Config, Spi};
|
use embassy_stm32::spi::{Config, Spi};
|
||||||
use embassy_stm32::time::Hertz;
|
use embassy_stm32::time::Hertz;
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
@ -2,16 +2,16 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
use core::str::from_utf8;
|
use core::str::from_utf8;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::spi::{Config, Spi};
|
use embassy_stm32::spi::{Config, Spi};
|
||||||
use embassy_stm32::time::Hertz;
|
use embassy_stm32::time::Hertz;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
use heapless::String;
|
use heapless::String;
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy_stm32::dma::NoDma;
|
use embassy_stm32::dma::NoDma;
|
||||||
use embassy_stm32::usart::{Config, Uart};
|
use embassy_stm32::usart::{Config, Uart};
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::dma::NoDma;
|
use embassy_stm32::dma::NoDma;
|
||||||
use embassy_stm32::usart::{Config, Uart};
|
use embassy_stm32::usart::{Config, Uart};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
|
||||||
use heapless::String;
|
use heapless::String;
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
use defmt::{info, unwrap};
|
use defmt::{info, unwrap};
|
||||||
use defmt_rtt as _; // global logger
|
use defmt_rtt as _; // global logger
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
use defmt::{info, unwrap};
|
use defmt::{info, unwrap};
|
||||||
use defmt_rtt as _; // global logger
|
use defmt_rtt as _; // global logger
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {"{=u64}", {
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ version = "0.1.0"
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] }
|
||||||
embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] }
|
embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] }
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::exti::ExtiInput;
|
use embassy_stm32::exti::ExtiInput;
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,14 +2,8 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use embassy_stm32::peripherals::ETH;
|
|
||||||
use example_common::config;
|
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use defmt::{info, unwrap};
|
use defmt::*;
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use embassy::executor::{Executor, Spawner};
|
use embassy::executor::{Executor, Spawner};
|
||||||
use embassy::io::AsyncWriteExt;
|
use embassy::io::AsyncWriteExt;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
@ -19,12 +13,16 @@ use embassy_net::{
|
|||||||
};
|
};
|
||||||
use embassy_stm32::eth::lan8742a::LAN8742A;
|
use embassy_stm32::eth::lan8742a::LAN8742A;
|
||||||
use embassy_stm32::eth::{Ethernet, State};
|
use embassy_stm32::eth::{Ethernet, State};
|
||||||
|
use embassy_stm32::interrupt;
|
||||||
|
use embassy_stm32::peripherals::ETH;
|
||||||
|
use embassy_stm32::peripherals::RNG;
|
||||||
use embassy_stm32::rng::Rng;
|
use embassy_stm32::rng::Rng;
|
||||||
use embassy_stm32::{interrupt, peripherals};
|
use embassy_stm32::time::U32Ext;
|
||||||
|
use embassy_stm32::Config;
|
||||||
use heapless::Vec;
|
use heapless::Vec;
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
use peripherals::RNG;
|
use defmt_rtt as _; // global logger
|
||||||
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::task]
|
#[embassy::task]
|
||||||
async fn main_task(
|
async fn main_task(
|
||||||
@ -88,6 +86,12 @@ static ETH: Forever<Ethernet<'static, ETH, LAN8742A, 4, 4>> = Forever::new();
|
|||||||
static CONFIG: Forever<StaticConfigurator> = Forever::new();
|
static CONFIG: Forever<StaticConfigurator> = Forever::new();
|
||||||
static NET_RESOURCES: Forever<StackResources<1, 2, 8>> = Forever::new();
|
static NET_RESOURCES: Forever<StackResources<1, 2, 8>> = Forever::new();
|
||||||
|
|
||||||
|
fn config() -> Config {
|
||||||
|
let mut config = Config::default();
|
||||||
|
config.rcc.sys_ck = Some(200.mhz().into());
|
||||||
|
config
|
||||||
|
}
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
info!("Hello World!");
|
info!("Hello World!");
|
||||||
|
@ -9,8 +9,8 @@ use embassy_stm32::time::Hertz;
|
|||||||
use embassy_stm32::Config;
|
use embassy_stm32::Config;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
fn config() -> Config {
|
fn config() -> Config {
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt_rtt as _; // global logger
|
||||||
mod example_common;
|
use panic_probe as _;
|
||||||
|
|
||||||
|
use defmt::*;
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::sdmmc::Sdmmc;
|
use embassy_stm32::sdmmc::Sdmmc;
|
||||||
use embassy_stm32::time::U32Ext;
|
use embassy_stm32::time::U32Ext;
|
||||||
use embassy_stm32::{interrupt, Config, Peripherals};
|
use embassy_stm32::{interrupt, Config, Peripherals};
|
||||||
use example_common::*;
|
|
||||||
|
|
||||||
fn config() -> Config {
|
fn config() -> Config {
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::dma::NoDma;
|
use embassy_stm32::dma::NoDma;
|
||||||
use embassy_stm32::usart::{Config, Uart};
|
use embassy_stm32::usart::{Config, Uart};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
use heapless::String;
|
use heapless::String;
|
||||||
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _;
|
|
||||||
use embassy_stm32::time::U32Ext;
|
|
||||||
use embassy_stm32::Config;
|
|
||||||
// global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {"{=u64}", {
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
pub fn config() -> Config {
|
|
||||||
let mut config = Config::default();
|
|
||||||
config.rcc.sys_ck = Some(200.mhz().into());
|
|
||||||
config
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ version = "0.1.0"
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] }
|
||||||
|
|
||||||
defmt = "0.3"
|
defmt = "0.3"
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::exti::ExtiInput;
|
use embassy_stm32::exti::ExtiInput;
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {"{=u64}", {
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,7 @@ version = "0.1.0"
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] }
|
||||||
embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
|
embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
|
||||||
mod example_common;
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
|
use defmt::*;
|
||||||
|
use defmt_rtt as _; // global logger
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy_stm32::exti::ExtiInput;
|
use embassy_stm32::exti::ExtiInput;
|
||||||
use embassy_stm32::gpio::{Input, Pull};
|
use embassy_stm32::gpio::{Input, Pull};
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
||||||
#[path = "../example_common.rs"]
|
use defmt::*;
|
||||||
mod example_common;
|
use defmt_rtt as _; // global logger
|
||||||
use embassy::executor::Spawner;
|
use embassy::executor::Spawner;
|
||||||
use embassy::time::{Duration, Timer};
|
use embassy::time::{Duration, Timer};
|
||||||
use embassy_stm32::pwm::{simple_pwm::SimplePwm, Channel};
|
use embassy_stm32::pwm::{simple_pwm::SimplePwm, Channel};
|
||||||
use embassy_stm32::time::U32Ext;
|
use embassy_stm32::time::U32Ext;
|
||||||
use embassy_stm32::Peripherals;
|
use embassy_stm32::Peripherals;
|
||||||
use example_common::*;
|
use panic_probe as _;
|
||||||
|
|
||||||
#[embassy::main]
|
#[embassy::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#![macro_use]
|
|
||||||
|
|
||||||
use defmt_rtt as _; // global logger
|
|
||||||
use panic_probe as _;
|
|
||||||
|
|
||||||
pub use defmt::*;
|
|
||||||
|
|
||||||
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
||||||
|
|
||||||
defmt::timestamp! {"{=u64}", {
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
|
||||||
n as u64
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,7 +8,7 @@ resolver = "2"
|
|||||||
[features]
|
[features]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
|
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] }
|
||||||
embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] }
|
embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] }
|
||||||
embassy-hal-common = { path = "../../embassy-hal-common", default-features = false, features = ["defmt"] }
|
embassy-hal-common = { path = "../../embassy-hal-common", default-features = false, features = ["defmt"] }
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user