mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 12:18:54 +08:00
sensors: Keep looping in sensors app even if gyros do not update any more. There are lots of other reasons we might want to keep clocking the system. This resolves the RC timeout dependency in HIL.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user