diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-22 21:55:54 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-22 21:55:54 +0000 |
commit | 9e3c18cfd114ffd892ead66460e9bc040904c25d (patch) | |
tree | de611df330178a7c539127b3d7f26e5420094a7b /nuttx/drivers/analog | |
parent | a8ab2aef243697e99a0c9eba0b9d9fba98444b27 (diff) | |
download | px4-nuttx-9e3c18cfd114ffd892ead66460e9bc040904c25d.tar.gz px4-nuttx-9e3c18cfd114ffd892ead66460e9bc040904c25d.tar.bz2 px4-nuttx-9e3c18cfd114ffd892ead66460e9bc040904c25d.zip |
Update to the STM32 ADC and CAN drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4215 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/analog')
-rw-r--r-- | nuttx/drivers/analog/adc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nuttx/drivers/analog/adc.c b/nuttx/drivers/analog/adc.c index ab374f973..261ffe29e 100644 --- a/nuttx/drivers/analog/adc.c +++ b/nuttx/drivers/analog/adc.c @@ -274,8 +274,12 @@ static ssize_t adc_read(FAR struct file *filep, FAR char *buffer, size_t buflen) /* Will the next message in the FIFO fit into the user buffer? */ - if (ret + msglen > buflen) + if (nread + msglen > buflen) { + /* No.. break out of the loop now with nread equal to the actual + * number of bytes transferred. + */ + break; } @@ -417,4 +421,3 @@ int adc_register(FAR const char *path, FAR struct adc_dev_s *dev) return register_driver(path, &adc_fops, 0444, dev); } - |