From 480f15fbcd96b10e9f263a69a811cc1f72fea5a4 Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Fri, 10 Mar 2023 17:13:28 +0100 Subject: [PATCH] clarifications after test --- down-the-stack/apps/src/bin/button.rs | 6 ++++-- down-the-stack/apps/src/bin/uarte_print.rs | 2 ++ down-the-stack/apps/src/lib.rs | 2 +- embedded-workshop-book/src/bsc-exercise.md | 4 ++-- embedded-workshop-book/src/button-implementation.md | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/down-the-stack/apps/src/bin/button.rs b/down-the-stack/apps/src/bin/button.rs index 7b6f2d3..3195c8d 100644 --- a/down-the-stack/apps/src/bin/button.rs +++ b/down-the-stack/apps/src/bin/button.rs @@ -1,12 +1,14 @@ #![no_main] #![no_std] -use cortex_m::asm; + use cortex_m_rt::entry; -use core::fmt::Write; + // this imports `down-the-stack/apps/lib.rs` to retrieve our global logger + panicking-behavior use apps as _; +// ⚠️ ⚠️ ⚠️ Don't change this file! ⚠️ ⚠️ ⚠️ + #[entry] fn main() -> ! { // to enable more verbose logs, go to your `Cargo.toml` and set defmt logging levels diff --git a/down-the-stack/apps/src/bin/uarte_print.rs b/down-the-stack/apps/src/bin/uarte_print.rs index 5e434d8..2df9c96 100644 --- a/down-the-stack/apps/src/bin/uarte_print.rs +++ b/down-the-stack/apps/src/bin/uarte_print.rs @@ -8,6 +8,8 @@ use core::fmt::Write; // this imports `down-the-stack/apps/lib.rs` to retrieve our global logger + panicking-behavior use apps as _; +// ⚠️ ⚠️ ⚠️ Don't change this file! ⚠️ ⚠️ ⚠️ + #[entry] fn main() -> ! { // to enable more verbose logs, go to your `Cargo.toml` and set defmt logging levels diff --git a/down-the-stack/apps/src/lib.rs b/down-the-stack/apps/src/lib.rs index 3446a8d..911961c 100644 --- a/down-the-stack/apps/src/lib.rs +++ b/down-the-stack/apps/src/lib.rs @@ -1,5 +1,5 @@ #![no_std] - +// ⚠️ ⚠️ ⚠️ Don't change this file! ⚠️ ⚠️ ⚠️ use panic_probe as _; // same panicking *behavior* as `panic-probe` but doesn't print a panic message diff --git a/embedded-workshop-book/src/bsc-exercise.md b/embedded-workshop-book/src/bsc-exercise.md index a5545fd..6441ff1 100644 --- a/embedded-workshop-book/src/bsc-exercise.md +++ b/embedded-workshop-book/src/bsc-exercise.md @@ -2,7 +2,7 @@ In this exercise you will learn how to write a board support crate by implementing buttons and the UARTE peripheral. -The template `down-the-stack/dk_bsc/src/lib.rs` already contains the LED and Timer implementations. +The template `down-the-stack/dk_bsc/src/lib.rs` already contains the LED and Timer implementations. Add your code to the designated lines. You'll find a //todo! there. You can test after each step by running the following command out of `down-the-stack/apps` ``` @@ -10,7 +10,7 @@ cargo run --bin hello ``` This program will not call any of the functions you are implementing, so it does not matter if they are incomplete. It will refuse to build if there are errors present in the `lib.rs`! -`down-the-stack/dk_bsc/src/lib_solution.rs` contains the full solution code. +`down-the-stack/dk_bsc/src/lib_solution.rs` contains the full solution code. Note for trainer: Introduction to the exercise is a guided tour through the template, and it's architecture. Make the participants aware of the placeholders for their implementations. run the hello example on the unmodified lib. diff --git a/embedded-workshop-book/src/button-implementation.md b/embedded-workshop-book/src/button-implementation.md index afc4064..9fddb63 100644 --- a/embedded-workshop-book/src/button-implementation.md +++ b/embedded-workshop-book/src/button-implementation.md @@ -38,8 +38,8 @@ Building this code brings up warnings about unused variables. ### Step 5: Add everything to the board struct. -In the definition of the board struct add a field for the `struct Buttons` -In the pub `fn init()` function. Add the button field to the instantiation of the Board struct, assigning the pins you defined earlier to the respective buttons. +In the definition of the `struct Board` add a field for the `struct Buttons`. +In the pub `fn init()` function, where `Board` is instantiated, add the button field, assigning the pins you defined earlier to the respective buttons.