Change filename and macros from AT91SAM3.. to SAM3.. to conform to Atmel's official...
[bertos.git] / bertos / cpu / cortex-m3 / drv / timer_cm3.h
index 3e47d294912bacc447ad4b1bc628001ed79a24b5..0d45ad26453e3177424b9a8700d92749727354a0 100644 (file)
 
 #include "cfg/cfg_timer.h"     /* CONFIG_TIMER */
 
+#include <cpu/detect.h>
+#include <cpu/irq.h>
+
 #if CPU_CM3_LM3S
        #include <io/lm3s.h>
 #elif CPU_CM3_STM32
        #include <io/stm32.h>
+#elif CPU_CM3_SAM3
+       #include <io/sam3.h>
 /*#elif  Add other families here */
 #else
        #error Unknown CPU
 
        INLINE hptime_t timer_hw_hpread(void)
        {
-               return NVIC_ST_CURRENT_R;
-       }
-
-       INLINE hptime_t timer_hw_hpticks(ticks_t clock)
-       {
-               return (TIMER_HW_CNT - timer_hw_hpread()) + clock * TIMER_HW_CNT;
+               return (TIMER_HW_CNT - NVIC_ST_CURRENT_R);
        }
 
 #else