diff options
Diffstat (limited to 'src/Hardware/IoPorts.cpp')
-rw-r--r-- | src/Hardware/IoPorts.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Hardware/IoPorts.cpp b/src/Hardware/IoPorts.cpp index 8e85fc83..9417cf36 100644 --- a/src/Hardware/IoPorts.cpp +++ b/src/Hardware/IoPorts.cpp @@ -15,12 +15,16 @@ # include "DuetNG/DueXn.h" #endif +#include <AnalogOut.h> +#include <Interrupts.h> +#include <AnalogIn.h> +using #if SAME5x -# include <AnalogIn.h> -using AnalogIn::AdcBits; -# include <AnalogOut.h> -# include <Interrupts.h> + AnalogIn +#else + LegacyAnalogIn #endif + ::AdcBits; #if SUPPORT_CAN_EXPANSION # include <CanId.h> @@ -172,7 +176,7 @@ void IoPort::Release() noexcept } // Attach an interrupt to the pin. Nor permitted if we allocated the pin in shared input mode. -bool IoPort::AttachInterrupt(StandardCallbackFunction callback, enum InterruptMode mode, CallbackParameter param) const noexcept +bool IoPort::AttachInterrupt(StandardCallbackFunction callback, InterruptMode mode, CallbackParameter param) const noexcept { return IsValid() && !isSharedInput && attachInterrupt(GetPinNoCheck(), callback, mode, param); } @@ -623,20 +627,16 @@ uint16_t IoPort::ReadAnalog() const noexcept /*static*/ void IoPort::WriteAnalog(Pin pin, float pwm, uint16_t freq) noexcept { -#if SAME5x - AnalogOut::Write(pin, pwm, freq); -#elif defined(DUET_NG) +#if defined(DUET_NG) if (pin >= DueXnExpansionStart) { DuetExpansion::AnalogOut(pin, pwm); } else +#endif { - AnalogOut(pin, pwm, freq); + AnalogOut::Write(pin, pwm, freq); } -#else - AnalogOut(pin, pwm, freq); -#endif } // Members of class PwmPort |