diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-01-14 23:30:23 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-01-14 23:30:23 +0300 |
commit | 8bd63eaab18a258999eab2bb52892db2561c3749 (patch) | |
tree | 910242c87a217bfa3cf83bd7481a99ea1d4fa0e9 /src/CAN | |
parent | 36eb4fe0cbdb55bf62d33e6743a8740853e783cd (diff) |
Various
Disable CAN FIFO overwrite mode on SAME70
Remove delays from CanClockLoop that are no longer needed
Overlap next step calculation with step high time when slow drivers are
used
Combined CalcNextStepTimeCartesian and CalcNextStepTimeDelta
Added NOPs to lengthen the last step pulse in a move on the SAME70
Diffstat (limited to 'src/CAN')
-rw-r--r-- | src/CAN/CanInterface.cpp | 9 | ||||
-rw-r--r-- | src/CAN/CanMotion.cpp | 3 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/CAN/CanInterface.cpp b/src/CAN/CanInterface.cpp index 8f5db659..7ac0776c 100644 --- a/src/CAN/CanInterface.cpp +++ b/src/CAN/CanInterface.cpp @@ -592,15 +592,12 @@ extern "C" [[noreturn]] void CanSenderLoop(void *) noexcept pendingBuffers = buf->next; } -#if 0 - buf->msg.move.DebugPrint(); -#endif // Send the message #if USE_NEW_CAN_DRIVER can0dev->SendMessage(TxBufferIndexMotion, MaxMotionSendWait, buf); #else - mcan_fd_send_ext_message(&mcan_instance, buf->id.GetWholeId(), reinterpret_cast<uint8_t*>(&(buf->msg)), buf->dataLength, TxBufferIndexMotion, - MaxMotionSendWait, buf->useBrs, buf->marker); + mcan_fd_send_ext_message(&mcan_instance, buf->id.GetWholeId(), reinterpret_cast<uint8_t*>(&(buf->msg)), buf->dataLength, + TxBufferIndexMotion, MaxMotionSendWait, buf->useBrs, buf->marker); #endif #ifdef CAN_DEBUG @@ -611,8 +608,6 @@ extern "C" [[noreturn]] void CanSenderLoop(void *) noexcept delay(50); debugPrintf("CCCR %08" PRIx32 ", PSR %08" PRIx32 ", ECR %08" PRIx32 ", TXBRP %08" PRIx32 ", TXBTO %08" PRIx32 ", st %08" PRIx32 "\n", MCAN1->MCAN_CCCR, MCAN1->MCAN_PSR, MCAN1->MCAN_ECR, MCAN1->MCAN_TXBRP, MCAN1->MCAN_TXBTO, GetAndClearStatusBits()); -#else - delay(2); // until we have the transmit fifo working, we need to delay to allow the message to be sent #endif // Free the message buffer. CanMessageBuffer::Free(buf); diff --git a/src/CAN/CanMotion.cpp b/src/CAN/CanMotion.cpp index 2698f179..c7725981 100644 --- a/src/CAN/CanMotion.cpp +++ b/src/CAN/CanMotion.cpp @@ -74,8 +74,7 @@ void CanMotion::AddMovement(const PrepParams& params, DriverId canDriver, int32_ buf->next = movementBufferList; movementBufferList = buf; - const CanRequestId rid = CanInterface::AllocateRequestId(canDriver.boardAddress); - auto move = buf->SetupRequestMessage<CanMessageMovementLinear>(rid, CanId::MasterAddress, canDriver.boardAddress); + auto move = buf->SetupRequestMessage<CanMessageMovementLinear>(0, CanId::MasterAddress, canDriver.boardAddress); // Common parameters move->accelerationClocks = lrintf(params.accelTime * StepTimer::StepClockRate); |