Disable uneeded assert.
[bertos.git] / bertos / cpu / arm / drv / stepper_at91.c
index eef7793e1726d77e829fc3fc550d7500bd4daaa4..df748da9c3b049081fd0ed63295638b6490ab0e7 100644 (file)
  * generator.
  * 
  *
- * \version $Id$
  *
  * \author Daniele Basile <asterix@develer.com>
  */
 
 #include "stepper_at91.h"
 
+#include "cfg/cfg_stepper.h"
 #include <cfg/macros.h>
 #include <cfg/debug.h>
 
@@ -63,7 +63,6 @@
 
 #include <io/arm.h>
 
-#include "appconfig.h"
 
 /*
  * Delay to set C compare to clear output
@@ -74,9 +73,9 @@
 /*
  * Forward declaration for interrupt handler
  */
-static void stepper_tc0_irq(void);
-static void stepper_tc1_irq(void);
-static void stepper_tc2_irq(void);
+static ISR_PROTO(stepper_tc0_irq);
+static ISR_PROTO(stepper_tc1_irq);
+static ISR_PROTO(stepper_tc2_irq);
 
 ///< Static array of timer counter struct for stepper.
 static struct TimerCounter stepper_timers[CONFIG_TC_STEPPER_MAX_NUM] =
@@ -253,7 +252,7 @@ INLINE void stepper_tc_tio_irq(struct TimerCounter * t)
 /*
  * Interrupt handler for timer counter TCKL0
  */
-static void ISR_FUNC stepper_tc0_irq(void)
+DECLARE_ISR(stepper_tc0_irq)
 {
        /*
         * Warning: when we read the status_reg register, we reset it.
@@ -263,16 +262,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;
 
@@ -281,9 +276,8 @@ static void ISR_FUNC stepper_tc0_irq(void)
 /*
  * Interrupt handler for timer counter TCKL1
  */
-static void ISR_FUNC stepper_tc1_irq(void)
+DECLARE_ISR(stepper_tc1_irq)
 {
-       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,14 +295,13 @@ static void ISR_FUNC stepper_tc1_irq(void)
 
        /* Inform hw that we have served the IRQ */
        AIC_EOICR = 0;
-       STEPPER_STROBE_OFF_1;
 }
 
 
 /*
  * Interrupt handler for timer counter TCKL2
  */
-static void ISR_FUNC stepper_tc2_irq(void)
+DECLARE_ISR(stepper_tc2_irq)
 {
 
        /*
@@ -319,14 +312,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 +361,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);
 
        /*