ms: rearrange code to allow clean exits
This allows gracefully terminating the application by introducing queue
timeouts.
Change-Id: I0b8deebc63cf4d936666fd68e1666d1917e89a5d
diff --git a/Transceiver52M/ms/ms_rx_lower.cpp b/Transceiver52M/ms/ms_rx_lower.cpp
index 4d6ce18..26ee131 100644
--- a/Transceiver52M/ms/ms_rx_lower.cpp
+++ b/Transceiver52M/ms/ms_rx_lower.cpp
@@ -142,10 +142,8 @@
memcpy(brst.sch_bits, sch_demod_bits, sizeof(sch_demod_bits));
}
- if (upper_is_ready) { // this is blocking, so only submit if there is a reader - only if upper exists!
- while (!rxqueue.spsc_push(&brst))
- ;
- }
+ while (upper_is_ready && !rxqueue.spsc_push(&brst))
+ ;
if (do_auto_gain)
maybe_update_gain(brst);