From 460aef7a6d31512803b9307529e269b924a372aa Mon Sep 17 00:00:00 2001 From: pixhawk Date: Sun, 25 Apr 2010 08:16:25 +0200 Subject: [PATCH] Fixed performance problems in simulation --- src/comm/MAVLinkSimulationLink.cc | 2 +- src/input/JoystickInput.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/comm/MAVLinkSimulationLink.cc b/src/comm/MAVLinkSimulationLink.cc index ec2d7ace0..d6e338cb0 100644 --- a/src/comm/MAVLinkSimulationLink.cc +++ b/src/comm/MAVLinkSimulationLink.cc @@ -116,7 +116,7 @@ void MAVLinkSimulationLink::run() } last = MG::TIME::getGroundTimeNow(); } - msleep((rate / 20)); + MG::SLEEP::msleep(2); } } diff --git a/src/input/JoystickInput.cc b/src/input/JoystickInput.cc index 4de27617b..8fb761858 100644 --- a/src/input/JoystickInput.cc +++ b/src/input/JoystickInput.cc @@ -104,7 +104,7 @@ void JoystickInput::init() // Wait for joysticks if none is connected while (numJoysticks == 0) { - msleep(200); + MG::SLEEP::msleep(200); // INITIALIZE SDL Joystick support if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_NOPARACHUTE) < 0) { @@ -276,7 +276,7 @@ void JoystickInput::run() } // Sleep, update rate of joystick is approx. 50 Hz (1000 ms / 50 = 20 ms) - msleep(20); + MG::SLEEP::msleep(20); } -- 2.22.0