Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/GPIO
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2022-01-04 13:00:00 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-01-04 13:00:00 +0300
commit8e58dcacf096b2f82037c393c6c628483548d569 (patch)
tree8f19725fa75a6b977654e854f5f242c016459949 /src/GPIO
parent214e4fb2b768475e1a02d5565d49428ccd8fde99 (diff)
Support variable servo refresh frequency
Diffstat (limited to 'src/GPIO')
-rw-r--r--src/GPIO/GpOutPort.cpp4
-rw-r--r--src/GPIO/GpOutPort.h1
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;