diff --git a/Cargo.toml b/Cargo.toml index 3089f34742470f03ec9cda4ed1a5aa5db3bef303..f1088d7f691508fb6168306659de0b1761f64d7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ optional = true [dependencies.stm32f4xx-hal] git = "https://github.com/stm32-rs/stm32f4xx-hal.git" -version = "0.2.8" +version = "0.3.0" features = ["stm32f413", "rt"] optional = true diff --git a/examples/bare0.rs b/examples/bare0.rs index eef66f54ef142f84629473b2677374a48b2da98b..02cf056ce0ca1a4d4dbc6ba306ab899c7a2b2268 100644 --- a/examples/bare0.rs +++ b/examples/bare0.rs @@ -48,25 +48,27 @@ fn main() -> ! { // 1. Run the program in the debugger, let the program run for a while and // then press pause. Look in the (Local -vscode) Variables view what do you find. // -// ** your answer here ** +// X = 7893536 +// Y = 7893536 // // In the Expressions (WATCH -vscode) view add X and Y // what do you find // -// ** your answer here ** +// X and Y are less than x // // Step through one complete iteration of the loop // and see how the (Local) Variables are updated // can you foresee what will eventually happen? // -// ** place your answer here ** -// +// x will increment then X will increment, then Y will be set as the same as X and then +// it will assert the changes. + // Commit your answers (bare0_1) // // 2. Alter the constant X_INIT so that `x += 1` directly causes `x` to wrap // what happens when `x` wraps // -// ** your answer here ** +// Core panic, since the u32 int will overflow // // Commit your answers (bare0_2) // @@ -74,10 +76,12 @@ fn main() -> ! { // // Change (both) += opertions to use wrapping_add // load and run the progam, what happens -// ** your answer here ** + +// The variables wrapped around back to 0. // // Now continue exectution, what happens -// ** your answer here ** + +// The variables was incremeted as normal. // // Commit your answers (bare0_3) // @@ -86,7 +90,7 @@ fn main() -> ! { // // 4. Change the asserion to `assert!(x == X && X == Y + 1)`, what happens? // -// ** place your answer here ** +// The assert fails and we get core panic. // // Commit your answers (bare0_4) //