Skip to content

Commit

Permalink
fix event wait on thread
Browse files Browse the repository at this point in the history
  • Loading branch information
winemug committed Mar 16, 2019
1 parent 498ab29 commit 34ecebd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions podcomm/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ def _radio_loop(self):
self.radio_ready.set()
while True:
if not self.request_arrived.wait(timeout=10.0):
if self.send_final_complete.wait(timeout=0):
self.disconnect()
else:
continue
self.disconnect()
self.request_arrived.wait()
self.request_arrived.clear()

Expand Down Expand Up @@ -186,7 +183,7 @@ def _send_packet(self, packetToSend):
data += bytes([crc.crc8(data)])

self.logger.debug("SENDING FINAL PACKET: %s" % packetToSend)
received = self.packetRadio.send_and_receive_packet(data, 0, 0, 100, 3, 20)
received = self.packetRadio.send_and_receive_packet(data, 3, 100, 100, 3, 20)
if self.request_arrived.wait(timeout=0):
self.logger.debug("Prematurely exiting final phase to process next request")
self.packetSequence = (self.packetSequence + 2) % 32
Expand Down

0 comments on commit 34ecebd

Please sign in to comment.