diff --git a/libraries/AP_Winch/AP_Winch.cpp b/libraries/AP_Winch/AP_Winch.cpp index b333e61d11..c0568e4ec2 100644 --- a/libraries/AP_Winch/AP_Winch.cpp +++ b/libraries/AP_Winch/AP_Winch.cpp @@ -1,5 +1,5 @@ #include "AP_Winch.h" -#include "AP_Winch_Servo.h" +#include "AP_Winch_PWM.h" #include "AP_Winch_Daiwa.h" extern const AP_HAL::HAL& hal; @@ -11,7 +11,7 @@ const AP_Param::GroupInfo AP_Winch::var_info[] = { // @DisplayName: Winch Type // @Description: Winch Type // @User: Standard - // @Values: 0:None, 1:Servo, 2:Daiwa + // @Values: 0:None, 1:PWM, 2:Daiwa AP_GROUPINFO_FLAGS("_TYPE", 1, AP_Winch, config.type, (int8_t)WinchType::NONE, AP_PARAM_FLAG_ENABLE), // @Param: _RATE_MAX @@ -67,8 +67,8 @@ void AP_Winch::init() switch ((WinchType)config.type.get()) { case WinchType::NONE: break; - case WinchType::SERVO: - backend = new AP_Winch_Servo(config); + case WinchType::PWM: + backend = new AP_Winch_PWM(config); break; case WinchType::DAIWA: backend = new AP_Winch_Daiwa(config); diff --git a/libraries/AP_Winch/AP_Winch.h b/libraries/AP_Winch/AP_Winch.h index 58056b6aee..0e03f7d0a7 100644 --- a/libraries/AP_Winch/AP_Winch.h +++ b/libraries/AP_Winch/AP_Winch.h @@ -24,7 +24,7 @@ class AP_Winch_Backend; class AP_Winch { friend class AP_Winch_Backend; - friend class AP_Winch_Servo; + friend class AP_Winch_PWM; friend class AP_Winch_Daiwa; public: @@ -75,7 +75,7 @@ private: enum class WinchType { NONE = 0, - SERVO = 1, + PWM = 1, DAIWA = 2 }; diff --git a/libraries/AP_Winch/AP_Winch_Servo.cpp b/libraries/AP_Winch/AP_Winch_PWM.cpp similarity index 93% rename from libraries/AP_Winch/AP_Winch_Servo.cpp rename to libraries/AP_Winch/AP_Winch_PWM.cpp index fb2ed3f418..0263a7b851 100644 --- a/libraries/AP_Winch/AP_Winch_Servo.cpp +++ b/libraries/AP_Winch/AP_Winch_PWM.cpp @@ -1,10 +1,10 @@ -#include +#include "AP_Winch_PWM.h" #include extern const AP_HAL::HAL& hal; // true if winch is healthy -bool AP_Winch_Servo::healthy() const +bool AP_Winch_PWM::healthy() const { // return immediately if no servo is assigned to control the winch if (!SRV_Channels::function_assigned(SRV_Channel::k_winch)) { @@ -14,7 +14,7 @@ bool AP_Winch_Servo::healthy() const return true; } -void AP_Winch_Servo::update() +void AP_Winch_PWM::update() { // return immediately if no servo is assigned to control the winch if (!SRV_Channels::function_assigned(SRV_Channel::k_winch)) { @@ -29,7 +29,7 @@ void AP_Winch_Servo::update() } // update pwm outputs to control winch -void AP_Winch_Servo::control_winch() +void AP_Winch_PWM::control_winch() { const uint32_t now_ms = AP_HAL::millis(); float dt = (now_ms - control_update_ms) / 1000.0f; @@ -66,7 +66,7 @@ void AP_Winch_Servo::control_winch() } //send generator status -void AP_Winch_Servo::send_status(const GCS_MAVLINK &channel) +void AP_Winch_PWM::send_status(const GCS_MAVLINK &channel) { // prepare status bitmask uint32_t status_bitmask = 0; @@ -88,7 +88,7 @@ void AP_Winch_Servo::send_status(const GCS_MAVLINK &channel) } // write log -void AP_Winch_Servo::write_log() +void AP_Winch_PWM::write_log() { AP::logger().Write_Winch( healthy(), diff --git a/libraries/AP_Winch/AP_Winch_Servo.h b/libraries/AP_Winch/AP_Winch_PWM.h similarity index 96% rename from libraries/AP_Winch/AP_Winch_Servo.h rename to libraries/AP_Winch/AP_Winch_PWM.h index f276f520e0..493a312599 100644 --- a/libraries/AP_Winch/AP_Winch_Servo.h +++ b/libraries/AP_Winch/AP_Winch_PWM.h @@ -18,7 +18,7 @@ #include #include -class AP_Winch_Servo : public AP_Winch_Backend { +class AP_Winch_PWM : public AP_Winch_Backend { public: using AP_Winch_Backend::AP_Winch_Backend;