summaryrefslogtreecommitdiff
path: root/firmware/src/os/pit.c
diff options
context:
space:
mode:
authorlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-10-01 21:45:43 +0000
committerlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-10-01 21:45:43 +0000
commitbfff30bfec74c508e3f8904f8732799f30e6829d (patch)
treec104e38c808859adf0c7edcfd76873ce07b75f3b /firmware/src/os/pit.c
parent2b55faec5a6e3a4d2130ad341f01cd55116b64c3 (diff)
- 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
Diffstat (limited to 'firmware/src/os/pit.c')
-rw-r--r--firmware/src/os/pit.c12
1 files changed, 5 insertions, 7 deletions
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 <lib_AT91SAM7.h>
#include <AT91SAM7.h>
#include <os/pit.h>
+#include <os/system_irq.h>
#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);
}
personal git repositories of Harald Welte. Your mileage may vary