Merge pull request #42 from knurling-rs/update-defmt-0.2.0
Update to defmt 0.2.0
This commit is contained in:
+4
-4
@@ -9,11 +9,11 @@ version = "0.1.0"
|
|||||||
members = ["testsuite"]
|
members = ["testsuite"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m = "0.6.4"
|
cortex-m = "0.7.1"
|
||||||
cortex-m-rt = "0.6.13"
|
cortex-m-rt = "0.6.13"
|
||||||
defmt = "0.1.2"
|
defmt = "0.2.0"
|
||||||
defmt-rtt = "0.1.0"
|
defmt-rtt = "0.2.0"
|
||||||
panic-probe = { version = "0.1.0", features = ["print-defmt"] }
|
panic-probe = { version = "0.2.0", features = ["print-defmt"] }
|
||||||
# TODO(4) enter your HAL here
|
# TODO(4) enter your HAL here
|
||||||
# some-hal = "1.2.3"
|
# some-hal = "1.2.3"
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ $ cargo install flip-link
|
|||||||
#### 2. `probe-run`:
|
#### 2. `probe-run`:
|
||||||
|
|
||||||
``` console
|
``` console
|
||||||
|
$ # make sure to install v0.2.0 or later
|
||||||
$ cargo install probe-run
|
$ cargo install probe-run
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 3. [`cargo-generate`]:
|
#### 3. [`cargo-generate`]:
|
||||||
|
|
||||||
```
|
``` console
|
||||||
$ cargo install cargo-generate
|
$ cargo install cargo-generate
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -152,11 +153,11 @@ $ cargo install --git https://github.com/knurling-rs/probe-run --branch main
|
|||||||
|
|
||||||
``` console
|
``` console
|
||||||
$ probe-run --version
|
$ probe-run --version
|
||||||
probe-run 0.1.4 (3521a42 2020-11-12)
|
0.2.0 (aa585f2 2021-02-22)
|
||||||
supported defmt version: 3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4
|
supported defmt version: 60c6447f8ecbc4ff023378ba6905bcd0de1e679f
|
||||||
```
|
```
|
||||||
|
|
||||||
In the example output, the supported version is `3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4`
|
In the example output, the supported version is `60c6447f8ecbc4ff023378ba6905bcd0de1e679f`
|
||||||
|
|
||||||
3. Switch defmt dependencies to git: uncomment the last part of the root `Cargo.toml` and enter the hash reported by `probe-run --version`:
|
3. Switch defmt dependencies to git: uncomment the last part of the root `Cargo.toml` and enter the hash reported by `probe-run --version`:
|
||||||
|
|
||||||
@@ -167,10 +168,10 @@ In the example output, the supported version is `3db6b41f08a5c866e6d6ed7103d01b0
|
|||||||
-# defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
-# defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
-# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
-# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" }
|
||||||
+[patch.crates-io]
|
+[patch.crates-io]
|
||||||
+defmt = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
+defmt = { git = "https://github.com/knurling-rs/defmt", rev = "60c6447f8ecbc4ff023378ba6905bcd0de1e679f" }
|
||||||
+defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
+defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "60c6447f8ecbc4ff023378ba6905bcd0de1e679f" }
|
||||||
+defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
+defmt-test = { git = "https://github.com/knurling-rs/defmt", rev = "60c6447f8ecbc4ff023378ba6905bcd0de1e679f" }
|
||||||
+panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" }
|
+panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "60c6447f8ecbc4ff023378ba6905bcd0de1e679f" }
|
||||||
```
|
```
|
||||||
|
|
||||||
You are now using the git version of `defmt`!
|
You are now using the git version of `defmt`!
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ use {{crate_name}} as _; // global logger + panicking-behavior + memory layout
|
|||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
// value of the FREQUENCY register (nRF52840 device; RADIO peripheral)
|
// value of the FREQUENCY register (nRF52840 device; RADIO peripheral)
|
||||||
let frequency: u32 = 276;
|
let frequency: u32 = 276;
|
||||||
defmt::debug!("FREQUENCY: {0:0..7}, MAP: {0:8..9}", frequency);
|
defmt::debug!("FREQUENCY: {0=0..7}, MAP: {0=8..9}", frequency);
|
||||||
|
|
||||||
{{crate_name}}::exit()
|
{{crate_name}}::exit()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ fn main() -> ! {
|
|||||||
let s = S1 { x: 42, y: S2 { z: 43 } };
|
let s = S1 { x: 42, y: S2 { z: 43 } };
|
||||||
defmt::info!("s={:?}", s);
|
defmt::info!("s={:?}", s);
|
||||||
let x = 42;
|
let x = 42;
|
||||||
defmt::info!("x={:u8}", x);
|
defmt::info!("x={=u8}", x);
|
||||||
|
|
||||||
{{crate_name}}::exit()
|
{{crate_name}}::exit()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ fn main() -> ! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn ack(m: u32, n: u32) -> u32 {
|
fn ack(m: u32, n: u32) -> u32 {
|
||||||
defmt::info!("ack(m={:u32}, n={:u32})", m, n);
|
defmt::info!("ack(m={=u32}, n={=u32})", m, n);
|
||||||
let mut big = [2; 512];
|
let mut big = [2; 512];
|
||||||
if m == 0 {
|
if m == 0 {
|
||||||
n + 1
|
n + 1
|
||||||
|
|||||||
+4
-5
@@ -15,14 +15,13 @@ fn panic() -> ! {
|
|||||||
cortex_m::asm::udf()
|
cortex_m::asm::udf()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[defmt::timestamp]
|
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
||||||
fn timestamp() -> u64 {
|
defmt::timestamp!("{=usize}", {
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
|
||||||
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
||||||
let n = COUNT.load(Ordering::Relaxed);
|
let n = COUNT.load(Ordering::Relaxed);
|
||||||
COUNT.store(n + 1, Ordering::Relaxed);
|
COUNT.store(n + 1, Ordering::Relaxed);
|
||||||
n as u64
|
n
|
||||||
}
|
});
|
||||||
|
|
||||||
/// Terminates the application and makes `probe-run` exit with exit-code = 0
|
/// Terminates the application and makes `probe-run` exit with exit-code = 0
|
||||||
pub fn exit() -> ! {
|
pub fn exit() -> ! {
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ harness = false
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
{{project-name}} = { path = ".." }
|
{{project-name}} = { path = ".." }
|
||||||
cortex-m = "0.6.3"
|
cortex-m = "0.7.1"
|
||||||
cortex-m-rt = "0.6.12"
|
cortex-m-rt = "0.6.12"
|
||||||
defmt = "0.1.0"
|
defmt = "0.2.0"
|
||||||
defmt-rtt = "0.1.0"
|
defmt-rtt = "0.2.0"
|
||||||
defmt-test = "0.1.1"
|
defmt-test = "0.2.0"
|
||||||
panic-probe = { version = "0.1.0", features = ["print-defmt" ] }
|
panic-probe = { version = "0.2.0", features = ["print-defmt"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# set logging levels here
|
# set logging levels here
|
||||||
|
|||||||
Reference in New Issue
Block a user