From: c vw <dl1ycf@darc.de>
Date: Mon, 6 Jan 2020 09:49:38 +0000 (+0100)
Subject: clear IQ buffer upon restart
X-Git-Url: https://git.rkrishnan.org/pf/components/htmlfontify-example.html?a=commitdiff_plain;h=38d999465f4cd2be978fb144af9efd3936d1a8a9;p=pihpsdr.git

clear IQ buffer upon restart
---

diff --git a/old_protocol.c b/old_protocol.c
index a536b0e..f138735 100644
--- a/old_protocol.c
+++ b/old_protocol.c
@@ -1672,6 +1672,12 @@ static void metis_restart() {
   // reset current rx
   current_rx=0;
 
+  //
+  // When restarting, clear the IQ and audio samples
+  //
+  for(i=8;i<OZY_BUFFER_SIZE;i++) {
+    output_buffer[i]=0;
+  }
   // 
   // Some (older) HPSDR apps on the RedPitaya have very small
   // buffers that over-run if too much data is sent
@@ -1684,7 +1690,7 @@ static void metis_restart() {
     ozy_send_buffer();
   }
 
-  sleep(1);
+  usleep(250000L);
 
   // start the data flowing
   metis_start_stop(1);