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/CAN
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-01-25 21:02:36 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-01-25 21:02:36 +0300
commitc02479413cec5bb83ea06db7cad40640fe57a637 (patch)
tree4fd3065943b230faff25290207976b9b5d42ed43 /src/CAN
parent31f962d536c35527a176381b97f99a0de69347e5 (diff)
CanInterface fix for SAME70
Diffstat (limited to 'src/CAN')
-rw-r--r--src/CAN/CanInterface.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/CAN/CanInterface.cpp b/src/CAN/CanInterface.cpp
index 0cec09a1..6c6a71d1 100644
--- a/src/CAN/CanInterface.cpp
+++ b/src/CAN/CanInterface.cpp
@@ -197,14 +197,9 @@ static void InitReceiveFilters() noexcept
static void ReInit() noexcept
{
-#if SAME70
- mcan_stop(&mcan_instance);
- configure_mcan(); // this includes initialising the receive filters
-#else
can0dev->Disable();
InitReceiveFilters();
can0dev->Enable();
-#endif
}
#endif
@@ -403,8 +398,10 @@ extern "C" [[noreturn]] void CanClockLoop(void *) noexcept
if (gotTimeSyncTxTimeStamp)
{
# if SAME70
+ // On the SAME70 the step clock is also the external time stamp counter
const uint32_t timeSyncTxDelay = (timeSyncTxTimeStamp - (uint16_t)lastTimeSent) & 0xFFFF;
# else
+ // On the SAME5x the time stamp counter counts CAN but times divided by 64
const uint32_t timeSyncTxDelay = (((timeSyncTxTimeStamp - lastTimeSyncTxPreparedStamp) & 0xFFFF) * CanInterface::GetTimeStampPeriod()) >> 6;
# endif
if (timeSyncTxDelay > peakTimeSyncTxDelay)