Trond Enger / d7a_1x

Fork of d7a_1x by WizziLab

Revision:
70:07b378285c95
Parent:
69:18852c154df9
Child:
71:f03727ff0f99
--- a/src/d7a_alp.cpp	Thu Nov 03 09:45:18 2016 +0000
+++ b/src/d7a_alp.cpp	Thu Nov 03 10:56:17 2016 +0000
@@ -358,11 +358,18 @@
     int i = 0;
     d7a_alp_rsp_t* pl = NULL;
     d7a_com_rx_msg_t* pkt = NULL;
+    int32_t time;
+    Timer timeout;
+    
+    timeout.start();
     
     // Parse responses
     do
     {
-        pkt = d7a_alp_wait_pl(D7A_ALP_RESP_TO);
+        time = D7A_ALP_RESP_TO - timeout.read_ms();
+        if (time < 0) time = 0;
+        
+        pkt = d7a_alp_wait_pl(time);
         
         if (pkt == NULL)
         {