diff --git a/examples/bare5.rs b/examples/bare5.rs index 21957f7736d1e90b9f4bb67e6456ede1255c2f8a..055b34dacc5573b3ee79fc2fd4994842d83b917e 100644 --- a/examples/bare5.rs +++ b/examples/bare5.rs @@ -199,29 +199,19 @@ fn idle(rcc: &mut RCC, gpioa: &mut GPIOA) { let led_odr = &gpioa.ODR; loop { // set PA5 high -<<<<<<< HEAD - // gpioa.BSRRH.write(1 << 5); // set bit, output hight (turn on led) - gpioa.ODR.write(gpioa.ODR.read() | (1 << 5)); -======= // gpioa.ODR.modify(5u8, 1u8, 1u32); led_odr.modify(5u8, 1u8, 1u32); // gpioa.BSRRH.write(1 << 5); // set bit, output hight (turn on led) // gpioa.ODR.write(gpioa.ODR.read() | (1 << 5)); ->>>>>>> student-1 wait(10_000); // set PA5 low -<<<<<<< HEAD - // gpioa.BSRRL.write(1 << 5); // clear bit, output low (turn off led) - gpioa.ODR.write(gpioa.ODR.read() & !(1 << 5)); -======= // gpioa.ODR.modify(5u8, 1u8, 0u32); led_odr.modify(5u8, 1u8, 0u32); // gpioa.BSRRL.write(1 << 5); // clear bit, output low (turn off led) // gpioa.ODR.write(gpioa.ODR.read() & !(1 << 5)); ->>>>>>> student-1 wait(10_000); } } @@ -270,11 +260,4 @@ fn idle(rcc: &mut RCC, gpioa: &mut GPIOA) { // // Notice, over-shifting (where bits are spilled) is always considered legal, // its just the shift amuount that is checked. -// There are explicit unchecked versions available if so wanted. -// -// ** ORDERING IS WRONG FOR OPTIMIZED CODE ** -// When I run the --release build, the LED is constantly turned on. HOWEVER, -// if I set breakpoints and pause in the --release build, I can pause it -// just after the LED-turn-off call and the LED turns off, proving that the -// instructions work in release as they do in debug, but that it doesn't wait -// before running the turn-on call as it should. \ No newline at end of file +// There are explicit unchecked versions available if so wanted. \ No newline at end of file