Skip to content

Commit a34b8c5

Browse files
committed
wait to drain TX FIFO
1 parent 831063b commit a34b8c5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

examples/nrf24l01_stream_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ def master_fifo(count=1, size=32):
124124
nrf.flush_tx() # discard all payloads in TX FIFO
125125
print("Make sure slave() node is listening. Quitting master_fifo()")
126126
break
127+
# wait for radio to finish transmitting everything in the TX FIFO
128+
while failures < 99 and not nrf.fifo(about_tx=True, check_empty=True):
129+
# fifo() also update()s the StatusFlags
130+
if nrf.irq_df:
131+
failures += 1
132+
# manually restart transmissions because where done write()ing
133+
nrf.ce_pin = False
134+
nrf.clear_status_flags()
135+
nrf.ce_pin = True
127136
end_timer = time.monotonic_ns() # end timer
128137
nrf.ce_pin = False # enter inactive TX mode
129138
print(

0 commit comments

Comments
 (0)