aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-03-17 17:02:10 +0100
committerLorenz Meier <lm@inf.ethz.ch>2014-03-17 17:02:10 +0100
commitd940bdf7f64268d46503cf4b0b996bec3036603e (patch)
tree9f366ccbbf06d566140f733ff20261e54ce6b727 /src
parent4e6e40e5d850f737b25d657630ac89ad1d54e67c (diff)
downloadpx4-firmware-d940bdf7f64268d46503cf4b0b996bec3036603e.tar.gz
px4-firmware-d940bdf7f64268d46503cf4b0b996bec3036603e.tar.bz2
px4-firmware-d940bdf7f64268d46503cf4b0b996bec3036603e.zip
Consistently making space for a maximum of 12 channels, 10 channels (including reference / temperature) are used / available right now
Diffstat (limited to 'src')
-rw-r--r--src/drivers/stm32/adc/adc.cpp2
-rw-r--r--src/modules/sensors/sensors.cpp4
-rw-r--r--src/modules/uORB/topics/sensor_combined.h4
-rw-r--r--src/systemcmds/tests/test_adc.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/src/drivers/stm32/adc/adc.cpp b/src/drivers/stm32/adc/adc.cpp
index 00e46d6b8..0b8a275e6 100644
--- a/src/drivers/stm32/adc/adc.cpp
+++ b/src/drivers/stm32/adc/adc.cpp
@@ -341,7 +341,7 @@ test(void)
err(1, "can't open ADC device");
for (unsigned i = 0; i < 50; i++) {
- adc_msg_s data[10];
+ adc_msg_s data[12];
ssize_t count = read(fd, data, sizeof(data));
if (count < 0)
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp
index 6560dec3d..8da5bb294 100644
--- a/src/modules/sensors/sensors.cpp
+++ b/src/modules/sensors/sensors.cpp
@@ -1169,8 +1169,8 @@ Sensors::adc_poll(struct sensor_combined_s &raw)
hrt_abstime t = hrt_absolute_time();
/* rate limit to 100 Hz */
if (t - _last_adc >= 10000) {
- /* make space for a maximum of ten channels (to ensure reading all channels at once) */
- struct adc_msg_s buf_adc[10];
+ /* make space for a maximum of twelve channels (to ensure reading all channels at once) */
+ struct adc_msg_s buf_adc[12];
/* read all channels available */
int ret = read(_fd_adc, &buf_adc, sizeof(buf_adc));
diff --git a/src/modules/uORB/topics/sensor_combined.h b/src/modules/uORB/topics/sensor_combined.h
index 918389f38..117105470 100644
--- a/src/modules/uORB/topics/sensor_combined.h
+++ b/src/modules/uORB/topics/sensor_combined.h
@@ -99,8 +99,8 @@ struct sensor_combined_s {
float baro_pres_mbar; /**< Barometric pressure, already temp. comp. */
float baro_alt_meter; /**< Altitude, already temp. comp. */
float baro_temp_celcius; /**< Temperature in degrees celsius */
- float adc_voltage_v[9]; /**< ADC voltages of ADC Chan 10/11/12/13 or -1 */
- unsigned adc_mapping[9]; /**< Channel indices of each of these values */
+ float adc_voltage_v[10]; /**< ADC voltages of ADC Chan 10/11/12/13 or -1 */
+ unsigned adc_mapping[10]; /**< Channel indices of each of these values */
float mcu_temp_celcius; /**< Internal temperature measurement of MCU */
uint32_t baro_counter; /**< Number of raw baro measurements taken */
diff --git a/src/systemcmds/tests/test_adc.c b/src/systemcmds/tests/test_adc.c
index 7302f63cc..03391b851 100644
--- a/src/systemcmds/tests/test_adc.c
+++ b/src/systemcmds/tests/test_adc.c
@@ -66,8 +66,8 @@ int test_adc(int argc, char *argv[])
}
for (unsigned i = 0; i < 5; i++) {
- /* make space for a maximum of ten channels */
- struct adc_msg_s data[10];
+ /* make space for a maximum of twelve channels */
+ struct adc_msg_s data[12];
/* read all channels available */
ssize_t count = read(fd, data, sizeof(data));