From 6529d5019ccb1fc47eb3ce5ef313eff42ad10c74 Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 21 Feb 2023 13:50:23 +0100 Subject: [PATCH 1/7] rename hal to nrf-hal for clarity --- down-the-stack/dk_bsc/Cargo.toml | 5 +++-- down-the-stack/dk_bsc/src/lib.rs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/down-the-stack/dk_bsc/Cargo.toml b/down-the-stack/dk_bsc/Cargo.toml index 473bdca..21865c1 100644 --- a/down-the-stack/dk_bsc/Cargo.toml +++ b/down-the-stack/dk_bsc/Cargo.toml @@ -2,14 +2,15 @@ authors = ["Jorge Aparicio ", "Tanks Transfeld Date: Tue, 21 Feb 2023 13:50:36 +0100 Subject: [PATCH 2/7] correct dir name --- down-the-stack/apps/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/down-the-stack/apps/Cargo.toml b/down-the-stack/apps/Cargo.toml index 4dd8f81..6449d12 100644 --- a/down-the-stack/apps/Cargo.toml +++ b/down-the-stack/apps/Cargo.toml @@ -8,7 +8,7 @@ version = "0.0.0" [dependencies] cortex-m = {version = "0.7.6", features = ["critical-section-single-core"]} cortex-m-rt = "0.7.2" -dk_template = { path = "../dk_bsc" } +dk_bsc = { path = "../dk_bsc" } heapless = "0.7.16" panic-probe = { version = "0.3.0", features = ["print-defmt"] } defmt = "0.3.2" From f21124a304ad42762a7f41abcf50fdaa5237545e Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 21 Feb 2023 14:18:57 +0100 Subject: [PATCH 3/7] change setup --- down-the-stack/dk_bsc/src/lib_solution.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/down-the-stack/dk_bsc/src/lib_solution.rs b/down-the-stack/dk_bsc/src/lib_solution.rs index 5884013..267f02b 100644 --- a/down-the-stack/dk_bsc/src/lib_solution.rs +++ b/down-the-stack/dk_bsc/src/lib_solution.rs @@ -1,7 +1,6 @@ -//! Hardware Abstraction Layer (HAL) for the nRF52840 Development Kit +//! Board Support Crate (BSC) for the nRF52840 Development Kit #![deny(missing_docs)] -#![deny(warnings)] #![no_std] use core::{ @@ -13,9 +12,12 @@ use core::{ use cortex_m::asm; use embedded_hal::digital::v2::{OutputPin as _, StatefulOutputPin}; +use nrf52840_hal as hal; pub use hal::pac::{ UARTE1, uarte0::{ baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}}; + + use hal::{ gpio::{p0, Level, Output, Input, PullUp, Pin, Port, PushPull}, timer::OneShot, prelude::InputPin, From 8b31518a6f7f57858ef74b5932ccaacf6b9f6d67 Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 21 Feb 2023 16:22:03 +0100 Subject: [PATCH 4/7] rm dead code, correct comments --- down-the-stack/apps/src/bin/button.rs | 5 +---- down-the-stack/apps/src/bin/uarte_print.rs | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/down-the-stack/apps/src/bin/button.rs b/down-the-stack/apps/src/bin/button.rs index 35af227..7b6f2d3 100644 --- a/down-the-stack/apps/src/bin/button.rs +++ b/down-the-stack/apps/src/bin/button.rs @@ -4,7 +4,7 @@ use cortex_m::asm; use cortex_m_rt::entry; use core::fmt::Write; -// this imports `beginner/apps/lib.rs` to retrieve our global logger + panicking-behavior +// this imports `down-the-stack/apps/lib.rs` to retrieve our global logger + panicking-behavior use apps as _; #[entry] @@ -26,7 +26,4 @@ fn main() -> ! { } // this program does not `exit`; use Ctrl+C to terminate it - loop { - asm::nop(); - } } diff --git a/down-the-stack/apps/src/bin/uarte_print.rs b/down-the-stack/apps/src/bin/uarte_print.rs index b54b044..a2aebfc 100644 --- a/down-the-stack/apps/src/bin/uarte_print.rs +++ b/down-the-stack/apps/src/bin/uarte_print.rs @@ -4,7 +4,7 @@ use cortex_m::asm; use cortex_m_rt::entry; use core::fmt::Write; -// this imports `beginner/apps/lib.rs` to retrieve our global logger + panicking-behavior +// this imports `down-the-stack/apps/lib.rs` to retrieve our global logger + panicking-behavior use apps as _; #[entry] @@ -20,7 +20,7 @@ fn main() -> ! { let tx_buffer = "Hello\n"; - + // this program does not `exit`; use Ctrl+C to terminate it loop { if button_1.is_pushed() { uarte.write_str(tx_buffer).unwrap(); From fd5179420f60d0c88465f297703bdff9357e3fc3 Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 21 Feb 2023 16:32:16 +0100 Subject: [PATCH 5/7] rm deny warnings --- down-the-stack/dk_bsc/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/down-the-stack/dk_bsc/src/lib.rs b/down-the-stack/dk_bsc/src/lib.rs index 96ad447..52630da 100644 --- a/down-the-stack/dk_bsc/src/lib.rs +++ b/down-the-stack/dk_bsc/src/lib.rs @@ -1,7 +1,6 @@ -//! Hardware Abstraction Layer (HAL) for the nRF52840 Development Kit +//! Board Support Crate (BSC) for the nRF52840 Development Kit #![deny(missing_docs)] -#![deny(warnings)] #![no_std] use core::{ From ad7f9db944f4e33a4db8fbbe84075054f0b0ca7b Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 21 Feb 2023 16:41:51 +0100 Subject: [PATCH 6/7] rm duplicate line --- down-the-stack/dk_bsc/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/down-the-stack/dk_bsc/Cargo.toml b/down-the-stack/dk_bsc/Cargo.toml index 21865c1..95f1f6b 100644 --- a/down-the-stack/dk_bsc/Cargo.toml +++ b/down-the-stack/dk_bsc/Cargo.toml @@ -10,7 +10,6 @@ cortex-m = {version = "0.7.6", features = ["critical-section-single-core"]} cortex-m-rt = "0.7.2" embedded-hal = "0.2.7" nrf52840-hal = "0.14.0" -# hal = { package = "nrf52840-hal", version = "0.14.0" } panic-probe = { version = "0.3.0", features = ["print-defmt"] } defmt = "0.3.2" defmt-rtt = "0.3.2" From 1891f172538813119b7d565d7bdc8a321e5d65ac Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 21 Feb 2023 16:45:43 +0100 Subject: [PATCH 7/7] rm deprecated lines --- down-the-stack/dk_bsc/Cargo.toml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/down-the-stack/dk_bsc/Cargo.toml b/down-the-stack/dk_bsc/Cargo.toml index 95f1f6b..b174f74 100644 --- a/down-the-stack/dk_bsc/Cargo.toml +++ b/down-the-stack/dk_bsc/Cargo.toml @@ -22,11 +22,3 @@ default = [ "other-feature" ] other-feature = [] - -# do NOT modify these features -defmt-default = [] -defmt-trace = [] -defmt-debug = [] -defmt-info = [] -defmt-warn = [] -defmt-error = []