aboutsummaryrefslogtreecommitdiffstats
path: root/os/lib/src
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-09-30 06:34:55 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-09-30 06:34:55 +0000
commit0b5c313cdaff47b5180b30afd449ba7925169743 (patch)
tree70630b922d3f1f374fff303e1fba3196248f6598 /os/lib/src
parent8fa2bcdad9edb41d01c9ccf1ebbbe135713bf9c0 (diff)
downloadChibiOS-0b5c313cdaff47b5180b30afd449ba7925169743.tar.gz
ChibiOS-0b5c313cdaff47b5180b30afd449ba7925169743.tar.bz2
ChibiOS-0b5c313cdaff47b5180b30afd449ba7925169743.zip
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
Diffstat (limited to 'os/lib/src')
-rw-r--r--os/lib/src/chpipes.c10
1 files changed, 10 insertions, 0 deletions
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) {