summaryrefslogtreecommitdiff
path: root/openpicc/application/pio_irq.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-13 00:47:14 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-13 00:47:14 +0000
commit3d0a9bd40be2d014e0877eb623042c899d8cbe66 (patch)
tree16afede5c836924716cbd916ad1d63e5cc1be7c5 /openpicc/application/pio_irq.c
parent1dfa375abb95c59830c38697c53fa9a6794a9fb9 (diff)
Add PIO IRQ counter (and print it in 'c' command)
Make tc_cdiv_sync interrupt working Add 'p' command to print some PIO inputs Add 'z' command to enable/disable tc_cdiv_sync git-svn-id: https://svn.openpcd.org:2342/trunk@324 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/pio_irq.c')
-rw-r--r--openpicc/application/pio_irq.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/openpicc/application/pio_irq.c b/openpicc/application/pio_irq.c
index 572a4e4..c7238d8 100644
--- a/openpicc/application/pio_irq.c
+++ b/openpicc/application/pio_irq.c
@@ -38,6 +38,7 @@ struct pioirq_state {
};
static struct pioirq_state pirqs;
+static unsigned long count = 0;
/* low-level handler, used by Cstartup_app.S PIOA fast forcing and
* by regular interrupt handler below */
@@ -45,6 +46,7 @@ void __ramfunc __pio_irq_demux(u_int32_t pio)
{
u_int8_t send_usb = 0;
int i;
+ count++;
DEBUGPCRF("PIO_ISR_STATUS = 0x%08x", pio);
@@ -101,6 +103,12 @@ void pio_irq_disable(u_int32_t pio)
AT91F_PIO_InterruptDisable(AT91C_BASE_PIOA, pio);
}
+/* Return the number of PIO IRQs received */
+long pio_irq_get_count(void)
+{
+ return count;
+}
+
int pio_irq_register(u_int32_t pio, irq_handler_t *handler)
{
u_int8_t num = ffs(pio);
personal git repositories of Harald Welte. Your mileage may vary