File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -113,11 +113,13 @@ impl $crate::ehal_02::PwmPin for $TYPE {
113
113
fn disable( & mut self ) {
114
114
let count = self . tc. count16( ) ;
115
115
count. ctrla( ) . modify( |_, w| w. enable( ) . clear_bit( ) ) ;
116
+ while count. syncbusy( ) . read( ) . enable( ) . bit_is_set( ) { }
116
117
}
117
118
118
119
fn enable( & mut self ) {
119
120
let count = self . tc. count16( ) ;
120
121
count. ctrla( ) . modify( |_, w| w. enable( ) . set_bit( ) ) ;
122
+ while count. syncbusy( ) . read( ) . enable( ) . bit_is_set( ) { }
121
123
}
122
124
123
125
fn get_duty( & self ) -> Self :: Duty {
@@ -228,10 +230,12 @@ impl $crate::ehal_02::Pwm for $TYPE {
228
230
229
231
fn disable( & mut self , _channel: Self :: Channel ) {
230
232
self . tcc. ctrla( ) . modify( |_, w| w. enable( ) . clear_bit( ) ) ;
233
+ while self . tcc. syncbusy( ) . read( ) . enable( ) . bit_is_set( ) { }
231
234
}
232
235
233
236
fn enable( & mut self , _channel: Self :: Channel ) {
234
237
self . tcc. ctrla( ) . modify( |_, w| w. enable( ) . set_bit( ) ) ;
238
+ while self . tcc. syncbusy( ) . read( ) . enable( ) . bit_is_set( ) { }
235
239
}
236
240
237
241
fn get_period( & self ) -> Self :: Time {
Original file line number Diff line number Diff line change @@ -243,11 +243,13 @@ impl<I: PinId> $crate::ehal_02::PwmPin for $TYPE<I> {
243
243
fn disable( & mut self ) {
244
244
let count = self . tc. count16( ) ;
245
245
count. ctrla( ) . modify( |_, w| w. enable( ) . clear_bit( ) ) ;
246
+ while count. syncbusy( ) . read( ) . enable( ) . bit_is_set( ) { }
246
247
}
247
248
248
249
fn enable( & mut self ) {
249
250
let count = self . tc. count16( ) ;
250
251
count. ctrla( ) . modify( |_, w| w. enable( ) . set_bit( ) ) ;
252
+ while count. syncbusy( ) . read( ) . enable( ) . bit_is_set( ) { }
251
253
}
252
254
253
255
You can’t perform that action at this time.
0 commit comments