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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/lib/src/chpipes.c b/os/lib/src/chpipes.c
index 34c8870fb..8057fdab8 100644
--- a/os/lib/src/chpipes.c
+++ b/os/lib/src/chpipes.c
@@ -138,8 +138,8 @@ static size_t pipe_read(pipe_t *pp, uint8_t *bp, size_t n) {
size_t s1, s2;
/* Number of bytes that can be read in a single atomic operation.*/
- if (n > chPipeGetFreeCount(pp)) {
- n = chPipeGetFreeCount(pp);
+ if (n > chPipeGetUsedCount(pp)) {
+ n = chPipeGetUsedCount(pp);
}
/* Number of bytes before buffer limit.*/