File tree 11 files changed +19
-23
lines changed
11 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ fn main() -> ! {
149
149
print_temperature ( & mut uart, temp) ;
150
150
151
151
loop {
152
- cortex_m:: asm:: nop ( ) ;
152
+ cortex_m:: asm:: wfi ( ) ;
153
153
}
154
154
}
155
155
Original file line number Diff line number Diff line change @@ -139,9 +139,8 @@ fn main() -> ! {
139
139
// In this case, we just ignore the result. A real application
140
140
// would do something with the measurement.
141
141
142
- #[ allow( clippy:: empty_loop) ]
143
142
loop {
144
- // Empty loop
143
+ cortex_m :: asm :: wfi ( ) ;
145
144
}
146
145
}
147
146
Original file line number Diff line number Diff line change @@ -147,11 +147,7 @@ fn main() -> ! {
147
147
148
148
loop {
149
149
// interrupts handle everything else in this example.
150
- // if we wanted low power we could go to sleep. to
151
- // keep this example simple we'll just execute a `nop`.
152
- // the `nop` (No Operation) instruction does nothing,
153
- // but if we have no code here clippy would complain.
154
- cortex_m:: asm:: nop ( ) ;
150
+ cortex_m:: asm:: wfi ( ) ;
155
151
}
156
152
}
157
153
Original file line number Diff line number Diff line change @@ -97,9 +97,8 @@ fn main() -> ! {
97
97
98
98
// Demo finish - just loop until reset
99
99
100
- #[ allow( clippy:: empty_loop) ]
101
100
loop {
102
- // Empty loop
101
+ cortex_m :: asm :: wfi ( ) ;
103
102
}
104
103
}
105
104
Original file line number Diff line number Diff line change @@ -113,9 +113,8 @@ fn main() -> ! {
113
113
lcd. write_str ( "HD44780!" , & mut delay) . unwrap ( ) ;
114
114
115
115
// Do nothing - we're finished
116
- #[ allow( clippy:: empty_loop) ]
117
116
loop {
118
- // Empty loop
117
+ cortex_m :: asm :: wfi ( ) ;
119
118
}
120
119
}
121
120
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ fn main() -> ! {
64
64
sm. start ( ) ;
65
65
66
66
// PIO runs in background, independently from CPU
67
- #[ allow( clippy:: empty_loop) ]
68
- loop { }
67
+ loop {
68
+ cortex_m:: asm:: wfi ( ) ;
69
+ }
69
70
}
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ fn main() -> ! {
54
54
sm. start ( ) ;
55
55
56
56
// PIO runs in background, independently from CPU
57
- #[ allow( clippy:: empty_loop) ]
58
- loop { }
57
+ loop {
58
+ cortex_m:: asm:: wfi ( ) ;
59
+ }
59
60
}
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ fn main() -> ! {
57
57
sm. start ( ) ;
58
58
59
59
// PIO runs in background, independently from CPU
60
- #[ allow( clippy:: empty_loop) ]
61
- loop { }
60
+ loop {
61
+ cortex_m:: asm:: wfi ( ) ;
62
+ }
62
63
}
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ fn main() -> ! {
91
91
cortex_m:: asm:: delay ( 10_000_000 ) ;
92
92
let _sm2 = sm2. stop ( ) ;
93
93
94
- #[ allow( clippy:: empty_loop) ]
95
- loop { }
94
+ loop {
95
+ cortex_m:: asm:: wfi ( ) ;
96
+ }
96
97
}
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ fn main() -> ! {
166
166
167
167
// In case the reboot fails
168
168
loop {
169
- cortex_m:: asm:: nop ( ) ;
169
+ cortex_m:: asm:: wfi ( ) ;
170
170
}
171
171
}
172
172
Original file line number Diff line number Diff line change @@ -121,9 +121,8 @@ fn main() -> ! {
121
121
Err ( _) => { } // handle errors
122
122
} ;
123
123
124
- #[ allow( clippy:: empty_loop) ]
125
124
loop {
126
- // Empty loop
125
+ cortex_m :: asm :: wfi ( ) ;
127
126
}
128
127
}
129
128
You can’t perform that action at this time.
0 commit comments