FlightTasks: replaced all hrt_elapsed() calls and unneeded hrt_ calls to safe performance

This commit is contained in:
Matthias Grob
2017-11-20 14:27:56 +01:00
committed by Beat Küng
parent 9fdb3ace0c
commit 8a4d51c630
3 changed files with 11 additions and 10 deletions
@@ -120,7 +120,7 @@ int FlightTaskManual::update()
int FlightTaskManual::_evaluate_sticks()
{
if (hrt_elapsed_time(&_sub_manual_control_setpoint.get().timestamp) < _timeout) {
if ((_time_stamp_current - _sub_manual_control_setpoint.get().timestamp) < _timeout) {
/* get data and scale correctly */
_sticks(0) = _sub_manual_control_setpoint.get().x; /* NED x, "pitch" [-1,1] */
_sticks(1) = _sub_manual_control_setpoint.get().y; /* NED y, "roll" [-1,1] */