Skip to content

Instantly share code, notes, and snippets.

@jamesmunns
Last active March 10, 2019 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmunns/05395e7fa5c72b509664f8923e58c2a1 to your computer and use it in GitHub Desktop.
Save jamesmunns/05395e7fa5c72b509664f8923e58c2a1 to your computer and use it in GitHub Desktop.
==> 001-unmodified.txt <==
text data bss dec hex filename
232048 0 16 232064 38a80 target/thumbv7em-none-eabihf/debug/examples/dw1000_rx_tx
32358 0 16 32374 7e76 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 002-master-c2ddfd3.txt <==
text data bss dec hex filename
233144 0 16 233160 38ec8 target/thumbv7em-none-eabihf/debug/examples/dw1000_rx_tx
32358 0 16 32374 7e76 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 003-retool-spi-2ac04e8.txt <==
text data bss dec hex filename
232760 0 16 232776 38d48 target/thumbv7em-none-eabihf/debug/examples/dw1000_rx_tx
33478 0 16 33494 82d6 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 101-unmodified-opt-z.txt <==
text data bss dec hex filename
39622 0 16 39638 9ad6 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 102-master-c2ddfd3-opt-z.txt <==
text data bss dec hex filename
39622 0 16 39638 9ad6 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 103-retool-spi-2ac04e8-opt-z.txt <==
text data bss dec hex filename
39570 0 16 39586 9aa2 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 201-unmodified-opt-s.txt <==
text data bss dec hex filename
30112 0 16 30128 75b0 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 202-master-c2ddfd3-opt-s.txt <==
text data bss dec hex filename
30228 0 16 30244 7624 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 203-retool-spi-2ac04e8-opt-s.txt <==
text data bss dec hex filename
29920 0 16 29936 74f0 target/thumbv7em-none-eabihf/release/examples/dw1000_rx_tx
==> 002-master-c2ddfd3.patch <==
diff --git a/Cargo.toml b/Cargo.toml
index 1f3ff5d..acfadd3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -111,3 +111,7 @@ opt-level = 3
[package.metadata.docs.rs]
all-features = true
+
+[patch.crates-io.nrf52-hal-common]
+git = "https://github.com/nrf-rs/nrf52-hal"
+rev = "c2ddfd356bac75202049500ecaa7b971c9af1705"
diff --git a/src/lib.rs b/src/lib.rs
index ad49036..88c86a1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -385,10 +385,14 @@ impl DWM1001 {
// - The frequency is set to a moderate value that the DW1000 can easily
// handle.
let spim2 = p.SPIM2.constrain(spim::Pins {
- sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
- mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
- miso: Some(pins.p0_18.into_floating_input().degrade()),
- });
+ sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
+ mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
+ miso: Some(pins.p0_18.into_floating_input().degrade()),
+ },
+ spim::Frequency::K500,
+ spim::MODE_0,
+ 0x00,
+ );
let twim1 = p.TWIM1.constrain(
twim::Pins {
==> 003-retool-spi-2ac04e8.patch <==
diff --git a/Cargo.toml b/Cargo.toml
index 1f3ff5d..d85e727 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -111,3 +111,7 @@ opt-level = 3
[package.metadata.docs.rs]
all-features = true
+
+[patch.crates-io.nrf52-hal-common]
+git = "https://github.com/nrf-rs/nrf52-hal"
+rev = "2ac04e8a419e38ef08e35b8c413fab163cdcb42b"
diff --git a/src/lib.rs b/src/lib.rs
index ad49036..88c86a1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -385,10 +385,14 @@ impl DWM1001 {
// - The frequency is set to a moderate value that the DW1000 can easily
// handle.
let spim2 = p.SPIM2.constrain(spim::Pins {
- sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
- mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
- miso: Some(pins.p0_18.into_floating_input().degrade()),
- });
+ sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
+ mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
+ miso: Some(pins.p0_18.into_floating_input().degrade()),
+ },
+ spim::Frequency::K500,
+ spim::MODE_0,
+ 0x00,
+ );
let twim1 = p.TWIM1.constrain(
twim::Pins {
==> 101-unmodified-opt-z.patch <==
diff --git a/Cargo.toml b/Cargo.toml
index 1f3ff5d..22fd1ac 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -106,7 +106,7 @@ required-features = ["dev", "rt"]
incremental = false
codegen-units = 1
lto = true
-opt-level = 3
+opt-level = 'z'
[package.metadata.docs.rs]
==> 102-master-c2ddfd3-opt-z.patch <==
diff --git a/Cargo.toml b/Cargo.toml
index 1f3ff5d..622e13a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -106,8 +106,12 @@ required-features = ["dev", "rt"]
incremental = false
codegen-units = 1
lto = true
-opt-level = 3
+opt-level = 'z'
[package.metadata.docs.rs]
all-features = true
+
+[patch.crates-io.nrf52-hal-common]
+git = "https://github.com/nrf-rs/nrf52-hal"
+rev = "c2ddfd356bac75202049500ecaa7b971c9af1705"
diff --git a/src/lib.rs b/src/lib.rs
index ad49036..88c86a1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -385,10 +385,14 @@ impl DWM1001 {
// - The frequency is set to a moderate value that the DW1000 can easily
// handle.
let spim2 = p.SPIM2.constrain(spim::Pins {
- sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
- mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
- miso: Some(pins.p0_18.into_floating_input().degrade()),
- });
+ sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
+ mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
+ miso: Some(pins.p0_18.into_floating_input().degrade()),
+ },
+ spim::Frequency::K500,
+ spim::MODE_0,
+ 0x00,
+ );
let twim1 = p.TWIM1.constrain(
twim::Pins {
==> 103-retool-spi-2ac04e8-opt-z.patch <==
diff --git a/Cargo.toml b/Cargo.toml
index 1f3ff5d..33f98d9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -106,8 +106,12 @@ required-features = ["dev", "rt"]
incremental = false
codegen-units = 1
lto = true
-opt-level = 3
+opt-level = 'z'
[package.metadata.docs.rs]
all-features = true
+
+[patch.crates-io.nrf52-hal-common]
+git = "https://github.com/nrf-rs/nrf52-hal"
+rev = "2ac04e8a419e38ef08e35b8c413fab163cdcb42b"
diff --git a/src/lib.rs b/src/lib.rs
index ad49036..88c86a1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -385,10 +385,14 @@ impl DWM1001 {
// - The frequency is set to a moderate value that the DW1000 can easily
// handle.
let spim2 = p.SPIM2.constrain(spim::Pins {
- sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
- mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
- miso: Some(pins.p0_18.into_floating_input().degrade()),
- });
+ sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
+ mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
+ miso: Some(pins.p0_18.into_floating_input().degrade()),
+ },
+ spim::Frequency::K500,
+ spim::MODE_0,
+ 0x00,
+ );
let twim1 = p.TWIM1.constrain(
twim::Pins {
==> 201-unmodified-opt-s.patch <==
diff --git a/Cargo.toml b/Cargo.toml
index 1f3ff5d..6f02f4e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -106,7 +106,7 @@ required-features = ["dev", "rt"]
incremental = false
codegen-units = 1
lto = true
-opt-level = 3
+opt-level = 's'
[package.metadata.docs.rs]
==> 202-master-c2ddfd3-opt-s.patch <==
diff --git a/Cargo.toml b/Cargo.toml
index 1f3ff5d..026a7ff 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -106,8 +106,12 @@ required-features = ["dev", "rt"]
incremental = false
codegen-units = 1
lto = true
-opt-level = 3
+opt-level = 's'
[package.metadata.docs.rs]
all-features = true
+
+[patch.crates-io.nrf52-hal-common]
+git = "https://github.com/nrf-rs/nrf52-hal"
+rev = "c2ddfd356bac75202049500ecaa7b971c9af1705"
diff --git a/src/lib.rs b/src/lib.rs
index ad49036..88c86a1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -385,10 +385,14 @@ impl DWM1001 {
// - The frequency is set to a moderate value that the DW1000 can easily
// handle.
let spim2 = p.SPIM2.constrain(spim::Pins {
- sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
- mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
- miso: Some(pins.p0_18.into_floating_input().degrade()),
- });
+ sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
+ mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
+ miso: Some(pins.p0_18.into_floating_input().degrade()),
+ },
+ spim::Frequency::K500,
+ spim::MODE_0,
+ 0x00,
+ );
let twim1 = p.TWIM1.constrain(
twim::Pins {
==> 203-retool-spi-2ac04e8-opt-s.patch <==
diff --git a/Cargo.toml b/Cargo.toml
index 1f3ff5d..0dfc3a5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -106,8 +106,12 @@ required-features = ["dev", "rt"]
incremental = false
codegen-units = 1
lto = true
-opt-level = 3
+opt-level = 's'
[package.metadata.docs.rs]
all-features = true
+
+[patch.crates-io.nrf52-hal-common]
+git = "https://github.com/nrf-rs/nrf52-hal"
+rev = "2ac04e8a419e38ef08e35b8c413fab163cdcb42b"
diff --git a/src/lib.rs b/src/lib.rs
index ad49036..88c86a1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -385,10 +385,14 @@ impl DWM1001 {
// - The frequency is set to a moderate value that the DW1000 can easily
// handle.
let spim2 = p.SPIM2.constrain(spim::Pins {
- sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
- mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
- miso: Some(pins.p0_18.into_floating_input().degrade()),
- });
+ sck : pins.p0_16.into_push_pull_output(Level::Low).degrade(),
+ mosi: Some(pins.p0_20.into_push_pull_output(Level::Low).degrade()),
+ miso: Some(pins.p0_18.into_floating_input().degrade()),
+ },
+ spim::Frequency::K500,
+ spim::MODE_0,
+ 0x00,
+ );
let twim1 = p.TWIM1.constrain(
twim::Pins {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment