aboutsummaryrefslogtreecommitdiffstats
path: root/os/lib/src/chpipes.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/lib/src/chpipes.c')
-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) {