File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,7 @@ where
179
179
// before any DMA action has started.
180
180
compiler_fence ( SeqCst ) ;
181
181
182
- // Reset the events.
183
- self . 0 . events_endtx . reset ( ) ;
184
-
182
+
185
183
// Set up the DMA write.
186
184
self . 0 . txd . ptr . write ( |w|
187
185
// We're giving the register a pointer to the stack. Since we're
@@ -200,11 +198,15 @@ where
200
198
// values.
201
199
unsafe { w. maxcnt ( ) . bits ( tx_buffer. len ( ) as _ ) } ) ;
202
200
201
+ // Reset the event
202
+ self . 0 . events_endtx . reset ( ) ;
203
+
203
204
// Start UARTE Transmit transaction.
204
205
self . 0 . tasks_starttx . write ( |w|
205
206
// `1` is a valid value to write to task registers.
206
207
unsafe { w. bits ( 1 ) } ) ;
207
208
209
+
208
210
// Wait for transmission to end.
209
211
while self . 0 . events_endtx . read ( ) . bits ( ) == 0 {
210
212
// TODO: Do something here which uses less power. Like `wfi`.
@@ -215,6 +217,9 @@ where
215
217
// after all possible DMA actions have completed.
216
218
compiler_fence ( SeqCst ) ;
217
219
220
+ // Reset the event
221
+ self . 0 . events_txstopped . reset ( ) ;
222
+
218
223
// Lower power consumption by disabling the transmitter once we're
219
224
// finished.
220
225
self . 0 . tasks_stoptx . write ( |w|
You can’t perform that action at this time.
0 commit comments