From 0b5c313cdaff47b5180b30afd449ba7925169743 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 30 Sep 2018 06:34:55 +0000 Subject: Enhanced tests on pipes, added check on reset state. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12308 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/lib/src/chpipes.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'os/lib/src') diff --git a/os/lib/src/chpipes.c b/os/lib/src/chpipes.c index 8057fdab8..6ce029205 100644 --- a/os/lib/src/chpipes.c +++ b/os/lib/src/chpipes.c @@ -251,6 +251,11 @@ size_t chPipeWriteTimeout(pipe_t *pp, const uint8_t *bp, chDbgCheck(n > 0U); + /* If the pipe is in reset state then returns immediately.*/ + if (pp->reset) { + return MSG_RESET; + } + P_LOCK(pp); while (n > 0U) { @@ -308,6 +313,11 @@ size_t chPipeReadTimeout(pipe_t *pp, uint8_t *bp, chDbgCheck(n > 0U); + /* If the pipe is in reset state then returns immediately.*/ + if (pp->reset) { + return MSG_RESET; + } + P_LOCK(pp); while (n > 0U) { -- cgit v1.2.3