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
diff options
context:
space:
mode:
Diffstat (limited to 'src/InputMonitors')
-rw-r--r--src/InputMonitors/InputMonitor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/InputMonitors/InputMonitor.cpp b/src/InputMonitors/InputMonitor.cpp
index 5bc4a97e..45e6a9a3 100644
--- a/src/InputMonitors/InputMonitor.cpp
+++ b/src/InputMonitors/InputMonitor.cpp
@@ -35,7 +35,12 @@ bool InputMonitor::Activate(bool useInterrupt) noexcept
{
// Analog port
state = port.ReadAnalog() >= threshold;
- ok = port.SetAnalogCallback(CommonAnalogPortInterrupt, CallbackParameter(this), 1);
+ ok =
+#if SAME5x
+ !useInterrupt || port.SetAnalogCallback(CommonAnalogPortInterrupt, CallbackParameter(this), 1);
+#else
+ true; // SAME70 doesn't support SetAnalogCallback yet
+#endif
}
active = true;
whenLastSent = millis();