mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-04 05:05:19 +08:00
module: increase max timeout for stopping modules from 2s to 5s
The gps module might take up to 4s to stop (if stopped during module configuration).
This commit is contained in:
@@ -239,10 +239,12 @@ public:
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
unlock_module();
|
unlock_module();
|
||||||
px4_usleep(20000); // 20 ms
|
px4_usleep(10000); // 10 ms
|
||||||
lock_module();
|
lock_module();
|
||||||
|
|
||||||
if (++i > 100 && _task_id != -1) { // wait at most 2 sec
|
if (++i > 500 && _task_id != -1) { // wait at most 5 sec
|
||||||
|
PX4_ERR("timeout, forcing stop");
|
||||||
|
|
||||||
if (_task_id != task_id_is_work_queue) {
|
if (_task_id != task_id_is_work_queue) {
|
||||||
px4_task_delete(_task_id);
|
px4_task_delete(_task_id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user