bring back _request_exec_move()
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Wed, 23 Mar 2016 21:11:15 +0000 (14:11 -0700)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Wed, 23 Mar 2016 21:11:15 +0000 (14:11 -0700)
src/stepper.c

index 8d380bf68a47e2035b2685e4e0bb0cc08e9599e3..f4f731ff4d7fae20c28018d43ac5747bc1ac8c53 100644 (file)
@@ -75,6 +75,13 @@ ISR(ADCB_CH0_vect) {
 }
 
 
+static void _request_exec_move() {
+  // Use ADC as a "software" interrupt to trigger next move exec
+  ADCB_CH0_INTCTRL = ADC_CH_INTLVL_LO_gc; // LO level interrupt
+  ADCB_CTRLA = ADC_ENABLE_bm | ADC_CH0START_bm;
+}
+
+
 /// Step timer interrupt routine
 /// Dequeue move and load into stepper struct
 ISR(STEP_TIMER_ISR) {
@@ -127,9 +134,8 @@ ISR(STEP_TIMER_ISR) {
   st.prep_dwell = 0; // clear dwell
   st.move_ready = false;  // flip the flag back
 
-  // Use ADC as a "software" interrupt to prep next move
-  ADCB_CH0_INTCTRL = ADC_CH_INTLVL_LO_gc; // trigger LO interrupt
-  ADCB_CTRLA = ADC_ENABLE_bm | ADC_CH0START_bm;
+  // Request next move
+  _request_exec_move();
 }