Use embassy/defmt-timestamp-uptime in all examples.

This commit is contained in:
Dario Nieuwenhuis
2022-04-02 04:35:06 +02:00
parent a9e63167e1
commit 82803bffda
162 changed files with 490 additions and 765 deletions

View File

@ -6,7 +6,7 @@ version = "0.1.0"
resolver = "2"
[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", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "subghz", "unstable-pac", "exti"] }
embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time"] }

View File

@ -2,13 +2,13 @@
#![no_main]
#![feature(type_alias_impl_trait)]
#[path = "../example_common.rs"]
mod example_common;
use defmt::*;
use defmt_rtt as _; // global logger
use embassy::executor::Spawner;
use embassy::time::{Duration, Timer};
use embassy_stm32::gpio::{Level, Output, Speed};
use embassy_stm32::Peripherals;
use example_common::*;
use panic_probe as _;
#[embassy::main]
async fn main(_spawner: Spawner, p: Peripherals) {

View File

@ -2,10 +2,10 @@
#![no_main]
#![feature(type_alias_impl_trait)]
#[path = "../example_common.rs"]
mod example_common;
use defmt::*;
use defmt_rtt as _; // global logger
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
use example_common::*;
use panic_probe as _;
use cortex_m_rt::entry;

View File

@ -2,13 +2,13 @@
#![no_main]
#![feature(type_alias_impl_trait)]
#[path = "../example_common.rs"]
mod example_common;
use defmt::*;
use defmt_rtt as _; // global logger
use embassy::executor::Spawner;
use embassy_stm32::exti::ExtiInput;
use embassy_stm32::gpio::{Input, Pull};
use embassy_stm32::Peripherals;
use example_common::*;
use panic_probe as _;
#[embassy::main]
async fn main(_spawner: Spawner, p: Peripherals) {

View File

@ -5,8 +5,8 @@
#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
#[path = "../example_common.rs"]
mod example_common;
use defmt_rtt as _; // global logger
use panic_probe as _;
use embassy_lora::{stm32wl::*, LoraTimer};
use embassy_stm32::{

View File

@ -5,9 +5,10 @@
#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
#[path = "../example_common.rs"]
mod example_common;
use defmt_rtt as _; // global logger
use panic_probe as _;
use defmt::*;
use embassy::channel::signal::Signal;
use embassy::interrupt::{Interrupt, InterruptExt};
use embassy_stm32::dma::NoDma;
@ -16,7 +17,6 @@ use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
use embassy_stm32::interrupt;
use embassy_stm32::subghz::*;
use embassy_stm32::Peripherals;
use example_common::unwrap;
const PING_DATA: &str = "PING";
const DATA_LEN: u8 = PING_DATA.len() as u8;

View File

@ -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
}
}