From 17893958bf07b579c69ddc100c0718345a6ac993 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 16 May 2017 13:55:35 +1000 Subject: [PATCH] HAL_PX4: cope with brushed motors in read_last_sent() we need the value before scaling is applied, so slew rates can work --- libraries/AP_HAL_PX4/RCOutput.cpp | 9 ++++++++- libraries/AP_HAL_PX4/RCOutput.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_PX4/RCOutput.cpp b/libraries/AP_HAL_PX4/RCOutput.cpp index 57f3abe659..506994fff6 100644 --- a/libraries/AP_HAL_PX4/RCOutput.cpp +++ b/libraries/AP_HAL_PX4/RCOutput.cpp @@ -73,6 +73,7 @@ void PX4RCOutput::init() // ensure not to write zeros to disabled channels for (uint8_t i=0; i < PX4_NUM_OUTPUT_CHANNELS; i++) { _period[i] = PWM_IGNORE_THIS_CHANNEL; + _last_sent[i] = PWM_IGNORE_THIS_CHANNEL; } } @@ -229,6 +230,7 @@ void PX4RCOutput::enable_ch(uint8_t ch) _enabled_channels |= (1U<