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:
authorDavid Crocker <dcrocker@eschertech.com>2019-11-14 00:33:15 +0300
committerDavid Crocker <dcrocker@eschertech.com>2019-11-14 00:33:15 +0300
commit0bd7e4618f0df71f271cc031604eb4d33f69cd8b (patch)
treeba5a3b233fb6dc0f0c74d231ef4f3d71807d5da1 /src/FilamentMonitors
parent54259da8a68b184f8c1bd5b91338aa71fa5492f4 (diff)
Refactor StepTimer and step interrupts
SoftTimer class renamed StepTimer. We now use instances of StepTimer to schedule step interrupts. This means we only need a single compare match interrupt from the step timer TC. In turn this allows us to chain two 16-bit timers together on the SAM4S and SAME70 so we no longer need to keep the upper 16 bits in software or use the overflow interrupt.
Diffstat (limited to 'src/FilamentMonitors')
-rw-r--r--src/FilamentMonitors/Duet3DFilamentMonitor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/FilamentMonitors/Duet3DFilamentMonitor.cpp b/src/FilamentMonitors/Duet3DFilamentMonitor.cpp
index 24fcf89b..cbdc58b5 100644
--- a/src/FilamentMonitors/Duet3DFilamentMonitor.cpp
+++ b/src/FilamentMonitors/Duet3DFilamentMonitor.cpp
@@ -21,14 +21,14 @@ Duet3DFilamentMonitor::Duet3DFilamentMonitor(unsigned int extruder, unsigned int
void Duet3DFilamentMonitor::InitReceiveBuffer()
{
edgeCaptureReadPointer = edgeCaptureWritePointer = 1;
- edgeCaptures[0] = StepTimer::GetInterruptClocks(); // pretend we just had a high-to-low transition
+ edgeCaptures[0] = StepTimer::GetTimerTicks(); // pretend we just had a high-to-low transition
state = RxdState::waitingForStartBit;
}
// ISR for when the pin state changes. It should return true if the ISR wants the commanded extrusion to be fetched.
bool Duet3DFilamentMonitor::Interrupt()
{
- uint32_t now = StepTimer::GetInterruptClocks();
+ uint32_t now = StepTimer::GetTimerTicks();
bool wantReading = false;
const size_t writePointer = edgeCaptureWritePointer; // capture volatile variable
if ((writePointer + 1) % EdgeCaptureBufferSize != edgeCaptureReadPointer) // if buffer is not full
@@ -81,7 +81,7 @@ Duet3DFilamentMonitor::PollResult Duet3DFilamentMonitor::PollReceiveBuffer(uint1
{
again = false;
const size_t writePointer = edgeCaptureWritePointer; // capture volatile variable
- const uint32_t now = StepTimer::GetInterruptClocks();
+ const uint32_t now = StepTimer::GetTimerTicks();
switch (state)
{
case RxdState::waitingForStartBit: