From 24362270bbdf61ceedf3cecaf63fb1d36571e554 Mon Sep 17 00:00:00 2001 From: asterix Date: Thu, 13 May 2010 12:23:13 +0000 Subject: [PATCH] remove unneed function. Use hpread in context switch benchmark. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3675 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/benchmark/context_switch.c | 4 ++-- bertos/cpu/arm/drv/timer_at91.c | 2 -- bertos/cpu/arm/drv/timer_at91.h | 7 ------- bertos/cpu/avr/drv/timer_avr.h | 8 -------- bertos/cpu/cortex-m3/drv/timer_cm3.h | 7 +------ bertos/drv/timer.h | 7 ------- 6 files changed, 3 insertions(+), 32 deletions(-) diff --git a/bertos/benchmark/context_switch.c b/bertos/benchmark/context_switch.c index 92d9d9dc..a1a1d020 100644 --- a/bertos/benchmark/context_switch.c +++ b/bertos/benchmark/context_switch.c @@ -73,7 +73,7 @@ static void NORETURN hp_process(void) { sig_wait(SIG_USER0); #if CONFIG_USE_HP_TIMER - end = timer_clock_hp(); + end = timer_hw_hpread(); #endif #if CONFIG_USE_LED LED_ON(); @@ -91,7 +91,7 @@ static void NORETURN lp_process(void) { sig_wait(SIG_USER1); #if CONFIG_USE_HP_TIMER - start = timer_clock_hp(); + start = timer_hw_hpread(); #endif #if CONFIG_USE_LED LED_ON(); diff --git a/bertos/cpu/arm/drv/timer_at91.c b/bertos/cpu/arm/drv/timer_at91.c index 2508b64b..beab00d6 100644 --- a/bertos/cpu/arm/drv/timer_at91.c +++ b/bertos/cpu/arm/drv/timer_at91.c @@ -30,8 +30,6 @@ * * --> * - * \version $Id$ - * * \author Francesco Sacchi * * \brief Low-level timer module for Atmel AT91 (inplementation). diff --git a/bertos/cpu/arm/drv/timer_at91.h b/bertos/cpu/arm/drv/timer_at91.h index 63c2c644..0628d394 100644 --- a/bertos/cpu/arm/drv/timer_at91.h +++ b/bertos/cpu/arm/drv/timer_at91.h @@ -30,8 +30,6 @@ * * --> * - * \version $Id$ - * * \author Francesco Sacchi * * \brief Low-level timer module for Atmel AT91 (interface). @@ -99,11 +97,6 @@ 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 diff --git a/bertos/cpu/avr/drv/timer_avr.h b/bertos/cpu/avr/drv/timer_avr.h index 20764a1b..78225ff1 100644 --- a/bertos/cpu/avr/drv/timer_avr.h +++ b/bertos/cpu/avr/drv/timer_avr.h @@ -33,8 +33,6 @@ * * \brief Low-level timer module for AVR (interface). * - * \version $Id$ - * * \author Bernie Innocenti * \author Francesco Sacchi * \author Luca Ottaviano @@ -170,12 +168,6 @@ /** 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 */ diff --git a/bertos/cpu/cortex-m3/drv/timer_cm3.h b/bertos/cpu/cortex-m3/drv/timer_cm3.h index 3e47d294..1ee8b7a2 100644 --- a/bertos/cpu/cortex-m3/drv/timer_cm3.h +++ b/bertos/cpu/cortex-m3/drv/timer_cm3.h @@ -90,12 +90,7 @@ 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 diff --git a/bertos/drv/timer.h b/bertos/drv/timer.h index 0fd03074..50d118a9 100644 --- a/bertos/drv/timer.h +++ b/bertos/drv/timer.h @@ -41,7 +41,6 @@ * 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 * * $WIZ$ module_name = "timer" @@ -146,12 +145,6 @@ INLINE ticks_t timer_clock_unlocked(void) 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) -- 2.25.1