@@ -178,7 +178,7 @@ macro_rules! make_timer {
178
178
179
179
// The above line raises an update event which will indicate that the timer is already finished.
180
180
// Since this is not the case, it should be cleared.
181
- self . tim. sr( ) . modify ( |_, w| w. uif( ) . clear_bit( ) ) ;
181
+ self . tim. sr( ) . write ( |_, w| w. uif( ) . clear_bit( ) ) ;
182
182
183
183
$tq. initialize( MonoTimerBackend :: <pac:: $timer> { _tim: PhantomData } ) ;
184
184
$overflow. store( 0 , Ordering :: SeqCst ) ;
@@ -231,7 +231,7 @@ macro_rules! make_timer {
231
231
}
232
232
233
233
fn clear_compare_flag( ) {
234
- Self :: tim( ) . sr( ) . modify ( |_, w| w. cc2if( ) . clear_bit( ) ) ;
234
+ Self :: tim( ) . sr( ) . write ( |_, w| w. cc2if( ) . clear_bit( ) ) ;
235
235
}
236
236
237
237
fn pend_interrupt( ) {
@@ -249,13 +249,13 @@ macro_rules! make_timer {
249
249
fn on_interrupt( ) {
250
250
// Full period
251
251
if Self :: tim( ) . sr( ) . read( ) . uif( ) . bit_is_set( ) {
252
- Self :: tim( ) . sr( ) . modify ( |_, w| w. uif( ) . clear_bit( ) ) ;
252
+ Self :: tim( ) . sr( ) . write ( |_, w| w. uif( ) . clear_bit( ) ) ;
253
253
let prev = $overflow. fetch_add( 1 , Ordering :: Relaxed ) ;
254
254
assert!( prev % 2 == 1 , "Monotonic must have missed an interrupt!" ) ;
255
255
}
256
256
// Half period
257
257
if Self :: tim( ) . sr( ) . read( ) . cc1if( ) . bit_is_set( ) {
258
- Self :: tim( ) . sr( ) . modify ( |_, w| w. cc1if( ) . clear_bit( ) ) ;
258
+ Self :: tim( ) . sr( ) . write ( |_, w| w. cc1if( ) . clear_bit( ) ) ;
259
259
let prev = $overflow. fetch_add( 1 , Ordering :: Relaxed ) ;
260
260
assert!( prev % 2 == 0 , "Monotonic must have missed an interrupt!" ) ;
261
261
}
0 commit comments