rtic-rs / defmt-app-template

Quickly set up a `probe-run` + `defmt` + `flip-link` embedded project running the RTIC scheduler
Apache License 2.0
31 stars 11 forks source link

`defmt_brtt::init!()` missing in `init` task #11

Open 90degs2infty opened 1 year ago

90degs2infty commented 1 year ago

According to defmt_brtt's docs, one has to initialize defmt_brtt before using it:

You must also, somewhere in your code before calling any defmt logging function, call the defmt_brtt::init! macro.

fn main() {
    let _ = defmt_brtt::init!();
}

This template's init task currently reads:

#[init]
fn init(cx: init::Context) -> (Shared, Local) {
    defmt::info!("init");
    // ....
}

Is there a reason why the initialization is skipped? Or is it not necessary in the first place? It apparently works without the initialization, but I'm a little puzzled by the docs, still.