summaryrefslogtreecommitdiff
path: root/openpicc/application/pio_irq.c
diff options
context:
space:
mode:
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