From 032acaaee4c5a2dfe1c0dd0b7806b746f1648ada Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Fri, 20 Nov 2015 12:09:58 +0900 Subject: [PATCH] AP_EPM: use millis/micros/panic functions --- libraries/AP_EPM/AP_EPM.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_EPM/AP_EPM.cpp b/libraries/AP_EPM/AP_EPM.cpp index d1ccecfde6..67bf6b841f 100644 --- a/libraries/AP_EPM/AP_EPM.cpp +++ b/libraries/AP_EPM/AP_EPM.cpp @@ -86,7 +86,7 @@ void AP_EPM::grab() _flags.active = true; // capture time - _last_grab_or_release = hal.scheduler->millis(); + _last_grab_or_release = AP_HAL::millis(); // move the servo to the release position RC_Channel_aux::set_radio(RC_Channel_aux::k_epm, _grab_pwm); @@ -105,7 +105,7 @@ void AP_EPM::release() _flags.active = true; // capture time - _last_grab_or_release = hal.scheduler->millis(); + _last_grab_or_release = AP_HAL::millis(); // move the servo to the release position RC_Channel_aux::set_radio(RC_Channel_aux::k_epm, _release_pwm); @@ -131,12 +131,12 @@ void AP_EPM::neutral() void AP_EPM::update() { // move EPM PWM output back to neutral 2 seconds after the last grab or release - if (_flags.active && (hal.scheduler->millis() - _last_grab_or_release > EPM_RETURN_TO_NEUTRAL_MS)) { + if (_flags.active && (AP_HAL::millis() - _last_grab_or_release > EPM_RETURN_TO_NEUTRAL_MS)) { neutral(); } // re-grab the cargo intermittently - if (_flags.grab && (_regrab_interval > 0) && (hal.scheduler->millis() - _last_grab_or_release > ((uint32_t)_regrab_interval * 1000))) { + if (_flags.grab && (_regrab_interval > 0) && (AP_HAL::millis() - _last_grab_or_release > ((uint32_t)_regrab_interval * 1000))) { grab(); } }