diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-02-05 12:27:33 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-02-05 12:27:33 +0300 |
commit | 6351882b67bede9e19d64f7caa5e965568c1803c (patch) | |
tree | 4c01987841f65212132643eb500da96a6b0feac4 | |
parent | 21b914a3d3d2c980d22b77c3c0776ad0f23a0244 (diff) |
Enabled remote commands on Duet 3 MB6HC
-rw-r--r-- | src/Hardware/IoPorts.cpp | 2 | ||||
-rw-r--r-- | src/Hardware/IoPorts.h | 2 | ||||
-rw-r--r-- | src/InputMonitors/InputMonitor.cpp | 7 | ||||
-rw-r--r-- | src/Movement/StepTimer.cpp | 11 | ||||
-rw-r--r-- | src/Pins.h | 2 |
5 files changed, 19 insertions, 5 deletions
diff --git a/src/Hardware/IoPorts.cpp b/src/Hardware/IoPorts.cpp index 79e8ffb3..58370ead 100644 --- a/src/Hardware/IoPorts.cpp +++ b/src/Hardware/IoPorts.cpp @@ -189,7 +189,7 @@ void IoPort::DetachInterrupt() const noexcept } } -#if SUPPORT_REMOTE_COMMANDS +#if SAME5x bool IoPort::SetAnalogCallback(AnalogInCallbackFunction fn, CallbackParameter cbp, uint32_t ticksPerCall) noexcept { diff --git a/src/Hardware/IoPorts.h b/src/Hardware/IoPorts.h index 5866ae3a..22e44046 100644 --- a/src/Hardware/IoPorts.h +++ b/src/Hardware/IoPorts.h @@ -39,7 +39,7 @@ public: bool ReadDigital() const noexcept; bool AttachInterrupt(StandardCallbackFunction callback, InterruptMode mode, CallbackParameter param) const noexcept; void DetachInterrupt() const noexcept; -#if SUPPORT_REMOTE_COMMANDS +#if SAME5x bool SetAnalogCallback(AnalogInCallbackFunction fn, CallbackParameter cbp, uint32_t ticksPerCall) noexcept; #endif 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(); diff --git a/src/Movement/StepTimer.cpp b/src/Movement/StepTimer.cpp index cf69fc22..340db752 100644 --- a/src/Movement/StepTimer.cpp +++ b/src/Movement/StepTimer.cpp @@ -480,8 +480,17 @@ void StepTimer::CancelCallback() noexcept { reply.catf("next step interrupt due in %" PRIu32 " ticks, %s", pst->whenDue - GetTimerTicks(), - ((StepTc->INTENSET.reg & TC_INTFLAG_MC0) == 0) ? "disabled" : "enabled"); +# if SAME5x + ((StepTc->INTENSET.reg & TC_INTFLAG_MC0) == 0) +# elif SAME70 + ((STEP_TC->TC_CHANNEL[STEP_TC_CHAN].TC_IER & TC_IER_CPBS) == 0) +# endif + ? "disabled" : "enabled"); +# if SAME5x if (StepTc->CC[0].reg != pst->whenDue) +# elif SAME70 + if (STEP_TC->TC_CHANNEL[STEP_TC_CHAN].TC_RB != (uint16_t)pst->whenDue) +# endif { reply.cat(", CC0 mismatch!!"); } @@ -199,6 +199,6 @@ // Define SUPPORT_REMOTE_COMMANDS according to whether this hardware accepts commands over CAN // For now we exclude Duet 3 MB6HC because CoreNG doesn't support analog callbacks -#define SUPPORT_REMOTE_COMMANDS (SUPPORT_CAN_EXPANSION && !defined(DUET3_ATE) && !defined(DUET3_V06)) +#define SUPPORT_REMOTE_COMMANDS (SUPPORT_CAN_EXPANSION && !defined(DUET3_ATE)) #endif // PINS_H__ |