From: Joseph Coffland Date: Wed, 23 Mar 2016 21:11:15 +0000 (-0700) Subject: bring back _request_exec_move() X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=6050628039509ea166055ddef700bfe5f5c5db0a;p=bbctrl-firmware bring back _request_exec_move() --- diff --git a/src/stepper.c b/src/stepper.c index 8d380bf..f4f731f 100644 --- a/src/stepper.c +++ b/src/stepper.c @@ -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(); }