Browse Source

Merge branch 'adc_fix' into paul_estimator_mavlink2

sbg
Lorenz Meier 11 years ago
parent
commit
7a3873cdf2
  1. 2
      src/drivers/stm32/adc/adc.cpp
  2. 4
      src/modules/sensors/sensors.cpp
  3. 4
      src/modules/uORB/topics/sensor_combined.h
  4. 4
      src/systemcmds/tests/test_adc.c

2
src/drivers/stm32/adc/adc.cpp

@ -341,7 +341,7 @@ test(void) @@ -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)

4
src/modules/sensors/sensors.cpp

@ -1171,8 +1171,8 @@ Sensors::adc_poll(struct sensor_combined_s &raw) @@ -1171,8 +1171,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));

4
src/modules/uORB/topics/sensor_combined.h

@ -98,8 +98,8 @@ struct sensor_combined_s { @@ -98,8 +98,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 */
uint64_t baro_timestamp; /**< Barometer timestamp */

4
src/systemcmds/tests/test_adc.c

@ -66,8 +66,8 @@ int test_adc(int argc, char *argv[]) @@ -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));

Loading…
Cancel
Save