File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ use panic_semihosting as _;
6
6
7
7
use stm32f3xx_hal as hal;
8
8
9
+ use cortex_m:: asm;
9
10
use cortex_m_rt:: entry;
10
11
11
- use cortex_m:: asm;
12
12
use hal:: prelude:: * ;
13
13
use hal:: stm32;
14
14
use hal:: watchdog:: IndependentWatchDog ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use panic_semihosting as _;
7
7
8
8
use stm32f3xx_hal as hal;
9
9
10
+ use cortex_m:: asm;
10
11
use cortex_m_rt:: entry;
11
12
12
13
//use cortex_m_semihosting::hprintln;
@@ -148,5 +149,7 @@ fn main() -> ! {
148
149
// DOES NOT COMPILE
149
150
// tim8_ch1.output_to_pc6(gpioc.pc6.into_af4(&mut gpioc.moder, &mut gpioc.afrl));
150
151
151
- loop { }
152
+ loop {
153
+ asm:: wfi ( ) ;
154
+ }
152
155
}
Original file line number Diff line number Diff line change 7
7
8
8
use panic_semihosting as _;
9
9
10
- use cortex_m:: singleton;
10
+ use cortex_m:: { asm , singleton} ;
11
11
use cortex_m_rt:: entry;
12
12
use stm32f3xx_hal:: { pac, prelude:: * , serial:: Serial } ;
13
13
@@ -63,6 +63,6 @@ fn main() -> ! {
63
63
assert_eq ! ( tx_buf, rx_buf) ;
64
64
65
65
loop {
66
- continue ;
66
+ asm :: wfi ( ) ;
67
67
}
68
68
}
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use panic_semihosting as _;
7
7
8
8
use stm32f3xx_hal as hal;
9
9
10
+ use cortex_m:: asm;
10
11
use cortex_m_rt:: entry;
11
12
12
13
use hal:: pac;
@@ -61,5 +62,7 @@ fn main() -> ! {
61
62
// This succeeds, when master and slave of the SPI are connected.
62
63
assert_eq ! ( msg_send, msg_received) ;
63
64
64
- loop { }
65
+ loop {
66
+ asm:: wfi ( ) ;
67
+ }
65
68
}
You can’t perform that action at this time.
0 commit comments