From bfff30bfec74c508e3f8904f8732799f30e6829d Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 1 Oct 2006 21:45:43 +0000 Subject: - add proper system interrupt (shared) demultiplexing code - port debug unit, watchdog timer, periodic interval timer to system_irq.c git-svn-id: https://svn.openpcd.org:2342/trunk@252 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- firmware/src/os/pit.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'firmware/src/os/pit.c') diff --git a/firmware/src/os/pit.c b/firmware/src/os/pit.c index 5c096cc..8bf13ba 100644 --- a/firmware/src/os/pit.c +++ b/firmware/src/os/pit.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "../openpcd.h" @@ -95,12 +96,12 @@ void timer_add(struct timer_list *tl) local_irq_restore(flags); } -static void pit_irq(void) +static void pit_irq(u_int32_t sr) { struct timer_list *tl; unsigned long flags; - jiffies++; + jiffies += *AT91C_PITC_PIVR; /* this is the most simple/stupid algorithm one can come up with, but * hey, we're on a small embedded platform with only a hand ful @@ -131,10 +132,7 @@ void pit_init(void) AT91F_PITInit(AT91C_BASE_PITC, 1000 /* uS */, 48 /* MHz */); - AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, - OPENPCD_IRQ_PRIO_PIT, - AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE, - &pit_irq); + sysirq_register(AT91SAM7_SYSIRQ_PIT, &pit_irq); - //AT91F_PITEnableInt(AT91C_BASE_PITC); + AT91F_PITEnableInt(AT91C_BASE_PITC); } -- cgit v1.2.3