From 80bfa3f6c8d6fe9a18e9f4a58974de6dd274ae60 Mon Sep 17 00:00:00 2001 From: Rob Giseburt Date: Mon, 30 Jan 2017 15:46:42 -0600 Subject: [PATCH] Finishing transition to all-hardware timers for fwd-plan/exec, and direct call of load --- g2core/board/ArduinoDue/hardware.h | 5 ++--- g2core/board/G2v9/hardware.h | 5 ++--- g2core/board/printrboardg2/hardware.h | 5 ++--- g2core/board/sbv300/hardware.h | 5 ++--- g2core/stepper.cpp | 16 ---------------- 5 files changed, 8 insertions(+), 28 deletions(-) diff --git a/g2core/board/ArduinoDue/hardware.h b/g2core/board/ArduinoDue/hardware.h index 7a81cf07..de822ead 100644 --- a/g2core/board/ArduinoDue/hardware.h +++ b/g2core/board/ArduinoDue/hardware.h @@ -129,9 +129,8 @@ using Motate::OutputPin; // Timer definitions. See stepper.h and other headers for setup typedef TimerChannel<3,0> dda_timer_type; // stepper pulse generation in stepper.cpp -typedef TimerChannel<4,0> load_timer_type; // request load timer in stepper.cpp -typedef ServiceCall<1> exec_timer_type; // request exec timer in stepper.cpp -typedef ServiceCall<2> fwd_plan_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<4,0> exec_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<5,0> fwd_plan_timer_type; // request exec timer in stepper.cpp // Pin assignments diff --git a/g2core/board/G2v9/hardware.h b/g2core/board/G2v9/hardware.h index ab0e9872..ad586116 100644 --- a/g2core/board/G2v9/hardware.h +++ b/g2core/board/G2v9/hardware.h @@ -129,9 +129,8 @@ using Motate::OutputPin; // Timer definitions. See stepper.h and other headers for setup typedef TimerChannel<3,0> dda_timer_type; // stepper pulse generation in stepper.cpp -typedef TimerChannel<4,0> load_timer_type; // request load timer in stepper.cpp -typedef ServiceCall<1> exec_timer_type; // request exec timer in stepper.cpp -typedef ServiceCall<2> fwd_plan_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<4,0> exec_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<5,0> fwd_plan_timer_type; // request exec timer in stepper.cpp // Pin assignments diff --git a/g2core/board/printrboardg2/hardware.h b/g2core/board/printrboardg2/hardware.h index 3943f10d..197757cf 100644 --- a/g2core/board/printrboardg2/hardware.h +++ b/g2core/board/printrboardg2/hardware.h @@ -127,9 +127,8 @@ using Motate::OutputPin; // Timer definitions. See stepper.h and other headers for setup typedef TimerChannel<3,0> dda_timer_type; // stepper pulse generation in stepper.cpp -typedef TimerChannel<4,0> load_timer_type; // request load timer in stepper.cpp -typedef ServiceCall<1> exec_timer_type; // request exec timer in stepper.cpp -typedef ServiceCall<2> fwd_plan_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<4,0> exec_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<5,0> fwd_plan_timer_type; // request exec timer in stepper.cpp // Pin assignments diff --git a/g2core/board/sbv300/hardware.h b/g2core/board/sbv300/hardware.h index 4f424261..541d2153 100644 --- a/g2core/board/sbv300/hardware.h +++ b/g2core/board/sbv300/hardware.h @@ -126,9 +126,8 @@ using Motate::OutputPin; // Timer definitions. See stepper.h and other headers for setup typedef TimerChannel<3,0> dda_timer_type; // stepper pulse generation in stepper.cpp -typedef TimerChannel<4,0> load_timer_type; // request load timer in stepper.cpp -typedef ServiceCall<1> exec_timer_type; // request exec timer in stepper.cpp -typedef ServiceCall<2> fwd_plan_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<4,0> exec_timer_type; // request exec timer in stepper.cpp +typedef TimerChannel<5,0> fwd_plan_timer_type; // request exec timer in stepper.cpp // Pin assignments diff --git a/g2core/stepper.cpp b/g2core/stepper.cpp index 0b1c8f8c..05969b50 100644 --- a/g2core/stepper.cpp +++ b/g2core/stepper.cpp @@ -76,7 +76,6 @@ extern OutputPin debug_pin3; //extern OutputPin debug_pin4; dda_timer_type dda_timer {kTimerUpToMatch, FREQUENCY_DDA}; // stepper pulse generation -//load_timer_type load_timer; // triggers load of next stepper segment exec_timer_type exec_timer; // triggers calculation of next+1 stepper segment fwd_plan_timer_type fwd_plan_timer; // triggers planning of next block @@ -125,9 +124,6 @@ void stepper_init() // If you need more pulse width you need to drop the DDA clock rate dda_timer.setInterrupts(kInterruptOnOverflow | kInterruptPriorityHighest); - // setup software interrupt load timer -// load_timer.setInterrupts(kInterruptOnSoftwareTrigger | kInterruptPriorityHigh); - // setup software interrupt exec timer & initial condition exec_timer.setInterrupts(kInterruptOnSoftwareTrigger | kInterruptPriorityMedium); st_pre.buffer_state = PREP_BUFFER_OWNED_BY_EXEC; @@ -417,22 +413,10 @@ void st_request_load_move() stepper_debug("l"); if (st_pre.buffer_state == PREP_BUFFER_OWNED_BY_LOADER) { // bother interrupting stepper_debug("_"); -// load_timer.setInterruptPending(); _load_move(); } } -//namespace Motate { // Define timer inside Motate namespace -// template<> -// void load_timer_type::interrupt() -// { -// load_timer.getInterruptCause(); // read SR to clear interrupt condition -// stepper_debug("L>"); -// _load_move(); -// stepper_debug("L+\n"); -// } -//} // namespace Motate - /**************************************************************************************** * _load_move() - Dequeue move and load into stepper runtime structure *