diff --git a/examples/rtic_bare2.rs b/examples/rtic_bare2.rs index 0c88115a9e64c04348a745515ade06c978ac87a7..26ba3d23ab84084c5e5192a23b887ef1639b93da 100644 --- a/examples/rtic_bare2.rs +++ b/examples/rtic_bare2.rs @@ -39,7 +39,7 @@ const APP: () = { hprintln!("End {:?}", end).ok(); hprintln!("Diff {:?}", end.wrapping_sub(start)).ok(); - // wait(100); + wait(100); } }; @@ -138,10 +138,16 @@ fn wait(i: u32) { // // Dump the generated assembly for the "wait" function. // -// ** your answer here ** +// => 0x080004a0 <+0>: push {r7, lr} +// 0x080004a2 <+2>: mov r7, sp +// 0x080004a4 <+4>: nop +// 0x080004a6 <+6>: subs r0, #1 +// 0x080004a8 <+8>: bne.n 0x80004a4 <rtic_bare2::wait+4> +// 0x080004aa <+10>: pop {r7, pc} // // Answer in your own words, why you believe the generated code differs? // -// ** your answer here ** +// Now that the function needs to be more generic (it has several uses), the +// argument is now stored and used inside r0 instead of initialized inside the function. // // Commit your answers (bare2_3)