diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-09-30 05:38:03 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-09-30 05:38:03 +0000 |
commit | 8fa2bcdad9edb41d01c9ccf1ebbbe135713bf9c0 (patch) | |
tree | 0810a1752b0312c1ce321281d4fa8a0225e16daf /os/lib/src/chpipes.c | |
parent | f562ee4948dd1e2b9175dfa3f2a2c071023c6167 (diff) | |
download | ChibiOS-8fa2bcdad9edb41d01c9ccf1ebbbe135713bf9c0.tar.gz ChibiOS-8fa2bcdad9edb41d01c9ccf1ebbbe135713bf9c0.tar.bz2 ChibiOS-8fa2bcdad9edb41d01c9ccf1ebbbe135713bf9c0.zip |
Fixed small errors in pipes and pipes factory.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12307 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/lib/src/chpipes.c')
-rw-r--r-- | os/lib/src/chpipes.c | 4 |
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.*/
|