diff options
author | David Crocker <dcrocker@eschertech.com> | 2022-01-04 13:00:00 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2022-01-04 13:00:00 +0300 |
commit | 8e58dcacf096b2f82037c393c6c628483548d569 (patch) | |
tree | 8f19725fa75a6b977654e854f5f242c016459949 /src/GPIO | |
parent | 214e4fb2b768475e1a02d5565d49428ccd8fde99 (diff) |
Support variable servo refresh frequency
Diffstat (limited to 'src/GPIO')
-rw-r--r-- | src/GPIO/GpOutPort.cpp | 4 | ||||
-rw-r--r-- | src/GPIO/GpOutPort.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/GPIO/GpOutPort.cpp b/src/GPIO/GpOutPort.cpp index 188bb9f7..f17eec12 100644 --- a/src/GPIO/GpOutPort.cpp +++ b/src/GPIO/GpOutPort.cpp @@ -85,7 +85,7 @@ GCodeResult GpOutputPort::Configure(uint32_t gpioNumber, bool isServo, GCodeBuff if (!seenFreq) { - freq = (isServo) ? ServoRefreshFrequency : DefaultPinWritePwmFreq; + freq = (isServo) ? DefaultServoRefreshFrequency : DefaultPinWritePwmFreq; } GCodeResult rslt; @@ -176,7 +176,7 @@ GCodeResult GpOutputPort::AssignFromRemote(uint32_t gpioPortNumber, const CanMes const bool seenFreq = parser.GetUintParam('Q', freq); if (!seenFreq) { - freq = (isServo) ? ServoRefreshFrequency : DefaultPinWritePwmFreq; + freq = (isServo) ? DefaultServoRefreshFrequency : DefaultPinWritePwmFreq; } String<StringLength50> pinName; diff --git a/src/GPIO/GpOutPort.h b/src/GPIO/GpOutPort.h index 087e48f4..245d32f6 100644 --- a/src/GPIO/GpOutPort.h +++ b/src/GPIO/GpOutPort.h @@ -29,6 +29,7 @@ public: bool IsUnused() const noexcept; GCodeResult WriteAnalog(uint32_t gpioPortNumber, bool isServo, float pwm, const GCodeBuffer& gb, const StringRef& reply) noexcept; GCodeResult Configure(uint32_t gpioNumber, bool isServo, GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeException); + PwmFrequency GetPwmFrequency() const noexcept { return port.GetFrequency(); } #if SUPPORT_REMOTE_COMMANDS GCodeResult AssignFromRemote(uint32_t gpioPortNumber, const CanMessageGenericParser& parser, const StringRef& reply) noexcept; |