X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Farm%2Fdrv%2Fstepper_at91.c;h=fa1b6470cf943bd25e35cc5437ceadcbc3ebffff;hb=71743c2a5a8bf9dbf66a945fd9656baed0d16329;hp=eef7793e1726d77e829fc3fc550d7500bd4daaa4;hpb=99c9bbc62b1b6003eefd78bf1e1b83beae4b9f38;p=bertos.git diff --git a/bertos/cpu/arm/drv/stepper_at91.c b/bertos/cpu/arm/drv/stepper_at91.c index eef7793e..fa1b6470 100644 --- a/bertos/cpu/arm/drv/stepper_at91.c +++ b/bertos/cpu/arm/drv/stepper_at91.c @@ -55,6 +55,7 @@ #include "stepper_at91.h" +#include "cfg/cfg_stepper.h" #include #include @@ -63,7 +64,6 @@ #include -#include "appconfig.h" /* * Delay to set C compare to clear output @@ -263,16 +263,12 @@ static void ISR_FUNC stepper_tc0_irq(void) */ uint32_t status_reg = TC0_SR & TC0_IMR; - if ((status_reg & BV(TC_CPBS)) && (status_reg & BV(TC_CPAS))) - STEPPER_STROBE_ON; - if (status_reg & BV(TC_CPAS)) stepper_tc_tio_irq(&stepper_timers[TC_TIOA0]); if (status_reg & BV(TC_CPBS)) stepper_tc_tio_irq(&stepper_timers[TC_TIOB0]); - STEPPER_STROBE_OFF; /* Inform hw that we have served the IRQ */ AIC_EOICR = 0; @@ -283,7 +279,6 @@ static void ISR_FUNC stepper_tc0_irq(void) */ static void ISR_FUNC stepper_tc1_irq(void) { - STEPPER_STROBE_ON_1; /* * Warning: when we read the status_reg register, we reset it. * That mean if is occur an interrupt event we can read only @@ -301,7 +296,6 @@ static void ISR_FUNC stepper_tc1_irq(void) /* Inform hw that we have served the IRQ */ AIC_EOICR = 0; - STEPPER_STROBE_OFF_1; } @@ -319,14 +313,12 @@ static void ISR_FUNC stepper_tc2_irq(void) */ uint32_t status_reg = TC2_SR & TC2_IMR; - STEPPER_STROBE_ON_2; if (status_reg & BV(TC_CPAS)) stepper_tc_tio_irq(&stepper_timers[TC_TIOA2]); if (status_reg & BV(TC_CPBS)) stepper_tc_tio_irq(&stepper_timers[TC_TIOB2]); - STEPPER_STROBE_OFF_2; /* Inform hw that we have served the IRQ */ AIC_EOICR = 0; @@ -370,7 +362,7 @@ void stepper_tc_setup(int index, stepper_isr_t callback, struct Stepper *motor) *motor->timer->comp_c_reg = 0; //Register interrupt vector - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /*