From f6d4efae13bf50f758e738616bb21ef314e87be8 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 27 May 2015 09:57:59 +0200 Subject: [PATCH] cpu/stm32f0: make use of hwtimer_compat module --- cpu/stm32f0/Makefile.include | 3 ++ cpu/stm32f0/hwtimer_arch.c | 72 ------------------------------------ 2 files changed, 3 insertions(+), 72 deletions(-) delete mode 100644 cpu/stm32f0/hwtimer_arch.c diff --git a/cpu/stm32f0/Makefile.include b/cpu/stm32f0/Makefile.include index 19dc639308..86fe9f109f 100644 --- a/cpu/stm32f0/Makefile.include +++ b/cpu/stm32f0/Makefile.include @@ -1,3 +1,6 @@ export CORTEX = cortex-m0 +# use hwtimer compatibility module +USEMODULE += hwtimer_compat + include $(RIOTCPU)/Makefile.include.cortex_common diff --git a/cpu/stm32f0/hwtimer_arch.c b/cpu/stm32f0/hwtimer_arch.c deleted file mode 100644 index 3bccab5ebb..0000000000 --- a/cpu/stm32f0/hwtimer_arch.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup cpu_stm32f0 - * @{ - * - * @file - * @brief Implementation of the kernel's hwtimer interface - * - * The hardware timer implementation uses the Cortex build-in system timer as back-end. - * - * @author Hauke Petersen - * - * @} - */ - -#include "arch/hwtimer_arch.h" -#include "periph/timer.h" -#include "board.h" -#include "thread.h" - - -void irq_handler(int channel); -void (*timeout_handler)(int); - - -void hwtimer_arch_init(void (*handler)(int), uint32_t fcpu) -{ - timeout_handler = handler; - timer_init(HW_TIMER, 1, &irq_handler); -} - -void hwtimer_arch_enable_interrupt(void) -{ - timer_irq_enable(HW_TIMER); -} - -void hwtimer_arch_disable_interrupt(void) -{ - timer_irq_disable(HW_TIMER); -} - -void hwtimer_arch_set(unsigned long offset, short timer) -{ - timer_set(HW_TIMER, timer, offset); -} - -void hwtimer_arch_set_absolute(unsigned long value, short timer) -{ - timer_set_absolute(HW_TIMER, timer, value); -} - -void hwtimer_arch_unset(short timer) -{ - timer_clear(HW_TIMER, timer); -} - -unsigned long hwtimer_arch_now(void) -{ - return timer_read(HW_TIMER); -} - -void irq_handler(int channel) -{ - timeout_handler((short)(channel)); -}