diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-04-22 01:40:45 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-04-22 01:40:45 +0200 |
commit | 3a4874b22ec469bb77c46b37c1fd204f083202d7 (patch) | |
tree | bac0b58a84b4d49744dfb2e252d343d1b61bcb1a /src/modules | |
parent | 42e9c84d50bcfe3298b0d88bb35a42acdc51d5a2 (diff) | |
parent | ca77c380b5ce9094d58b23ac73f3b0c1cec3d046 (diff) | |
download | px4-firmware-3a4874b22ec469bb77c46b37c1fd204f083202d7.tar.gz px4-firmware-3a4874b22ec469bb77c46b37c1fd204f083202d7.tar.bz2 px4-firmware-3a4874b22ec469bb77c46b37c1fd204f083202d7.zip |
Merge branch 'sensors_loop' of github.com:PX4/Firmware into ekf_params
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/sensors/sensors.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index 4083b8b4f..67c725b1c 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -1254,7 +1254,7 @@ Sensors::adc_poll(struct sensor_combined_s &raw) } } _last_adc = t; - if (_battery_status.voltage_v > 0.0f) { + if (_battery_status.voltage_filtered_v > BATT_V_IGNORE_THRESHOLD) { /* announce the battery status if needed, just publish else */ if (_battery_pub > 0) { orb_publish(ORB_ID(battery_status), _battery_pub, &_battery_status); @@ -1571,12 +1571,10 @@ Sensors::task_main() while (!_task_should_exit) { - /* wait for up to 100ms for data */ - int pret = poll(&fds[0], (sizeof(fds) / sizeof(fds[0])), 100); + /* wait for up to 50ms for data */ + int pret = poll(&fds[0], (sizeof(fds) / sizeof(fds[0])), 50); - /* timed out - periodic check for _task_should_exit, etc. */ - if (pret == 0) - continue; + /* if pret == 0 it timed out - periodic check for _task_should_exit, etc. */ /* this is undesirable but not much we can do - might want to flag unhappy status */ if (pret < 0) { @@ -1615,7 +1613,7 @@ Sensors::task_main() perf_end(_loop_perf); } - printf("[sensors] exiting.\n"); + warnx("[sensors] exiting."); _sensors_task = -1; _exit(0); |