summaryrefslogtreecommitdiffstats
path: root/dma/ipe.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-04-20 22:04:48 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-04-20 22:04:48 +0200
commit8961cbbe81ad3644cca0fb5c24d0782a6791ce3a (patch)
treeb5d39f5f1361384cdc123e2a886537cafb018080 /dma/ipe.c
parent77c4d6e67debf0e729734d882df033c4c0f5b0c3 (diff)
parente43e5999f2af8b69185e0c627515cca755150418 (diff)
downloadpcitool-8961cbbe81ad3644cca0fb5c24d0782a6791ce3a.tar.gz
pcitool-8961cbbe81ad3644cca0fb5c24d0782a6791ce3a.tar.bz2
pcitool-8961cbbe81ad3644cca0fb5c24d0782a6791ce3a.tar.xz
pcitool-8961cbbe81ad3644cca0fb5c24d0782a6791ce3a.zip
Merge: disable complaining on empty_detected unless in debugging
Diffstat (limited to 'dma/ipe.c')
-rw-r--r--dma/ipe.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dma/ipe.c b/dma/ipe.c
index e7a292a..2fbf1ee 100644
--- a/dma/ipe.c
+++ b/dma/ipe.c
@@ -420,16 +420,19 @@ int dma_ipe_stream_read(pcilib_dma_context_t *vctx, pcilib_dma_engine_t dma, uin
memcpy(&cur, &start, sizeof(struct timeval));
while (((*last_written_addr_ptr == 0)||(ctx->last_read_addr == (*last_written_addr_ptr)))&&((wait == PCILIB_TIMEOUT_INFINITE)||(((cur.tv_sec - start.tv_sec)*1000000 + (cur.tv_usec - start.tv_usec)) < wait))) {
usleep(10);
+#ifdef IPEDMA_SUPPORT_EMPTY_DETECTED
+ if (*empty_detected_ptr) break;
+#endif /* IPEDMA_SUPPORT_EMPTY_DETECTED */
gettimeofday(&cur, NULL);
}
// Failing out if we exited on timeout
if ((ctx->last_read_addr == (*last_written_addr_ptr))||(*last_written_addr_ptr == 0)) {
#ifdef IPEDMA_SUPPORT_EMPTY_DETECTED
-//# ifdef IPEDMA_DEBUG
- if ((wait)&&(*last_written_addr_ptr))
+# ifdef IPEDMA_DEBUG
+ if ((wait)&&(*last_written_addr_ptr)&&(!*empty_detected_ptr))
pcilib_warning("The empty_detected flag is not set, but no data arrived within %lu us\n", wait);
-//# endif /* IPEDMA_DEBUG */
+# endif /* IPEDMA_DEBUG */
#endif /* IPEDMA_SUPPORT_EMPTY_DETECTED */
return (ret&PCILIB_STREAMING_FAIL)?PCILIB_ERROR_TIMEOUT:0;
}