From 7f28335f81e131b654f5ae3c81f06c2089707211 Mon Sep 17 00:00:00 2001 From: "Anton D. Kachalov" Date: Mon, 27 Jul 2015 17:24:15 +0300 Subject: [PATCH] [moxart/moxart_timer] Div clock by 8 Signed-off-by: Anton D. Kachalov --- arch/arm/src/moxart/moxart_timer.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/arm/src/moxart/moxart_timer.c b/arch/arm/src/moxart/moxart_timer.c index fea1a3ce45..d1b5d769e8 100644 --- a/arch/arm/src/moxart/moxart_timer.c +++ b/arch/arm/src/moxart/moxart_timer.c @@ -39,9 +39,11 @@ #include #include +#include #include #include +#include "arm.h" #include "up_arch.h" #define TM1_ADDR 0x98400000 @@ -82,29 +84,22 @@ enum timer_int { * ************************************************************/ -uint32_t inside = 0; -static uint32_t cmp = BOARD_32KOSC_FREQUENCY / 1000; +static uint32_t cmp = BOARD_32KOSC_FREQUENCY * 8 / 1000; int up_timerisr(int irq, uint32_t *regs) { uint32_t state; - inside++; /* Process timer interrupt */ state = getreg32(TM1_ADDR + INTR_STATE_TIMER); state &= ~0x7; putreg32(state, TM1_ADDR + INTR_STATE_TIMER); -// *(volatile int *)0x98700000 ^= 0x8; - *(volatile int *)0x98700000 |= 0x2; - /* Ready for the next interrupt */ - cmp = BOARD_32KOSC_FREQUENCY / 1000; putreg32(cmp, TM1_ADDR + COUNTER_TIMER); sched_process_timer(); - *(volatile int *)0x98700000 &= ~0x2; return 0; }