{
sig_wait(SIG_USER0);
#if CONFIG_USE_HP_TIMER
- end = timer_clock_hp();
+ end = timer_hw_hpread();
#endif
#if CONFIG_USE_LED
LED_ON();
{
sig_wait(SIG_USER1);
#if CONFIG_USE_HP_TIMER
- start = timer_clock_hp();
+ start = timer_hw_hpread();
#endif
#if CONFIG_USE_LED
LED_ON();
*
* -->
*
- * \version $Id$
- *
* \author Francesco Sacchi <batt@develer.com>
*
* \brief Low-level timer module for Atmel AT91 (inplementation).
*
* -->
*
- * \version $Id$
- *
* \author Francesco Sacchi <batt@develer.com>
*
* \brief Low-level timer module for Atmel AT91 (interface).
return PIIR & CPIV_MASK;
}
- INLINE hptime_t timer_hw_hpticks(ticks_t clock)
- {
- return timer_hw_hpread() + clock * TIMER_HW_CNT;
- }
-
#else
#error Unimplemented value for CONFIG_TIMER
*
* \brief Low-level timer module for AVR (interface).
*
- * \version $Id$
- *
* \author Bernie Innocenti <bernie@codewiz.org>
* \author Francesco Sacchi <batt@develer.com>
* \author Luca Ottaviano <lottaviano@develer.com>
/** Not needed, timer IRQ handler called only for timer source */
#define timer_hw_triggered() (true)
-
-INLINE hptime_t timer_hw_hpticks(ticks_t clock)
-{
- return timer_hw_hpread() + clock * TIMER_HW_CNT;
-}
-
void timer_hw_init(void);
#endif /* DRV_TIMER_AVR_H */
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
* Whenever a timer expires you need to explicitly arm it again with timer_add(). If you want to abort a timer, use timer_abort().
* You can use conversion macros when using msecs to specify the delay.
*
- * \version $Id$
* \author Bernie Innocenti <bernie@codewiz.org>
*
* $WIZ$ module_name = "timer"
return _clock;
}
-/**
- */
-INLINE hptime_t timer_clock_hp(void)
-{
- return timer_hw_hpticks(_clock);
-}
/** Convert \a ms [ms] to ticks. */
INLINE ticks_t ms_to_ticks(mtime_t ms)