summaryrefslogtreecommitdiffstats
path: root/dma
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-02-10 15:26:35 +0100
committerSuren A. Chilingaryan <csa@suren.me>2015-02-10 15:26:35 +0100
commitc2331dd0cafe7c483525af7ef87e03386aeee14a (patch)
treee1efa428bcd47409b89154edbcc95a48fff8c84a /dma
parent0002c0cc260a6a8e2b6c53f19ae99a625eca4355 (diff)
downloadpcitool-c2331dd0cafe7c483525af7ef87e03386aeee14a.tar.gz
pcitool-c2331dd0cafe7c483525af7ef87e03386aeee14a.tar.bz2
pcitool-c2331dd0cafe7c483525af7ef87e03386aeee14a.tar.xz
pcitool-c2331dd0cafe7c483525af7ef87e03386aeee14a.zip
Better handle empty_detected flag
Diffstat (limited to 'dma')
-rw-r--r--dma/ipe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dma/ipe.c b/dma/ipe.c
index b692e0d..0b415e8 100644
--- a/dma/ipe.c
+++ b/dma/ipe.c
@@ -405,6 +405,9 @@ 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);
}
@@ -412,7 +415,7 @@ int dma_ipe_stream_read(pcilib_dma_context_t *vctx, pcilib_dma_engine_t dma, uin
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))
+ 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_SUPPORT_EMPTY_DETECTED */