diff --git a/examples/rtic_bare2.rs b/examples/rtic_bare2.rs index 48fbb05ed22dc62b4fae75ef47161d19138ce23e..04266d7cbbfa598a29b99e95f7310f0c80c0967c 100644 --- a/examples/rtic_bare2.rs +++ b/examples/rtic_bare2.rs @@ -1,4 +1,4 @@ -//! bare2.rs +//! rtic_bare2.rs //! //! Measuring execution time //! @@ -10,11 +10,6 @@ #![no_main] #![no_std] -// use panic_halt as _; - -// use cortex_m::{iprintln, peripheral::DWT, Peripherals}; -// use cortex_m_rt::entry; - use cortex_m::peripheral::DWT; use cortex_m_semihosting::hprintln; use panic_semihosting as _; @@ -124,7 +119,7 @@ fn wait(i: u32) { // // Commit your answers (bare2_2) // -// 3. Now add a second call to `wait` (line 47). +// 3. Now add a second call to `wait` (line 42). // // Recompile and run until the breakpoint. // @@ -136,4 +131,4 @@ fn wait(i: u32) { // // ** your answer here ** // -// +// Commit your answers (bare2_3) diff --git a/examples/rtic_bare3.rs b/examples/rtic_bare3.rs index 74f6c52794dfaee1607eea64f7d1e7cd9e36f480..9173175c051d4b3e4615e0db20d2b08265d59763 100644 --- a/examples/rtic_bare3.rs +++ b/examples/rtic_bare3.rs @@ -1,4 +1,4 @@ -//! bare3.rs +//! rtic_bare3.rs //! //! Measuring execution time //! diff --git a/examples/rtic_bare4.rs b/examples/rtic_bare4.rs index a04efb300af1cdebfe5477138e460e80aeba536b..1d53d13715b0afe372d3ab430e5fe1c301fb740a 100644 --- a/examples/rtic_bare4.rs +++ b/examples/rtic_bare4.rs @@ -1,4 +1,4 @@ -//! bare4.rs +//! rtic_bare4.rs //! //! Access to Peripherals //! diff --git a/examples/rtic_bare5.rs b/examples/rtic_bare5.rs index 3fddcb3cf19f6ff0dea7203633ba039d327e6144..5686e1b7a24c32db2f45dd120b87c33605af10ee 100644 --- a/examples/rtic_bare5.rs +++ b/examples/rtic_bare5.rs @@ -1,4 +1,4 @@ -//! bare5.rs +//! rtic_bare5.rs //! //! C Like Peripheral API //! @@ -177,6 +177,8 @@ const APP: () = { let r = gpioa.MODER.read() & !(0b11 << (5 * 2)); // read and mask gpioa.MODER.write(r | 0b01 << (5 * 2)); // set output mode + // test_modify(); + loop { // set PA5 high gpioa.BSRRH.write(1 << 5); // set bit, output hight (turn on led) @@ -198,11 +200,6 @@ const APP: () = { } }; -// 0. Build and run the application. -// -// > cargo build --example bare5 -// (or use the vscode) -// // 1. C like API. // Using C the .h files are used for defining interfaces, like function signatures (prototypes), // structs and macros (but usually not the functions themselves). @@ -211,9 +208,8 @@ const APP: () = { // provided by ST (and other companies). Actually, the file presented here is mostly a // cut/paste/replace of the stm32f40x.h, just Rustified. // -// // In the loop we access PA5 through bit set/clear operations. -// Comment out those operations and uncomment the the ODR accesses. +// Comment out those operations and uncomment the ODR based accesses. // (They should have the same behavior, but is a bit less efficient.) // // Run and see that the program behaves the same. @@ -228,12 +224,10 @@ const APP: () = { // // Implement and check that running `test` gives you expected behavior. // -// Change the code into using your new API. +// Change the code into using your new `modify` API. // // Run and see that the program behaves the same. // -// Commit your answers (bare5_2) -// // Discussion: // As with arithmetic operations, default semantics differ in between // debug/dev and release builds. @@ -248,3 +242,5 @@ const APP: () = { // Wouldn't that be great? // // ** your answer here ** +// +// Commit your answers (bare5_2)