5
0
mirror of https://github.com/ArduPilot/ardupilot synced 2025-01-02 22:18:28 -04:00

AP_Winch: Change from division to multiplication

This commit is contained in:
murata 2022-03-12 02:35:51 +09:00 committed by Andrew Tridgell
parent e977f85647
commit 7897807a78
2 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ void AP_Winch_Daiwa::read_data_from_winch()
void AP_Winch_Daiwa::control_winch()
{
const uint32_t now_ms = AP_HAL::millis();
float dt = (now_ms - control_update_ms) / 1000.0f;
float dt = (now_ms - control_update_ms) * 0.001f;
if (dt > 1.0f) {
dt = 0.0f;
}

View File

@ -32,7 +32,7 @@ void AP_Winch_PWM::update()
void AP_Winch_PWM::control_winch()
{
const uint32_t now_ms = AP_HAL::millis();
float dt = (now_ms - control_update_ms) / 1000.0f;
float dt = (now_ms - control_update_ms) * 0.001f;
if (dt > 1.0f) {
dt = 0.0f;
}