From 2956aa340e480396fd5a37d558477f6e7ce9878b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 27 Aug 2020 16:15:43 +0200 Subject: [PATCH] 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). --- platforms/common/include/px4_platform_common/module.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platforms/common/include/px4_platform_common/module.h b/platforms/common/include/px4_platform_common/module.h index 229debb78b..e55795dc5d 100644 --- a/platforms/common/include/px4_platform_common/module.h +++ b/platforms/common/include/px4_platform_common/module.h @@ -239,10 +239,12 @@ public: do { unlock_module(); - px4_usleep(20000); // 20 ms + px4_usleep(10000); // 10 ms 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) { px4_task_delete(_task_id); }