mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
Merge branch 'irqattach'
This commit is contained in:
@@ -93,7 +93,6 @@ struct up_dev_s
|
||||
uint32_t uartbase; /* Base address of UART registers */
|
||||
uint32_t baud; /* Configured baud */
|
||||
uint32_t ier; /* Saved IER value */
|
||||
xcpt_t handler; /* UART interrupt handler */
|
||||
uint8_t irq; /* IRQ associated with this UART */
|
||||
uint8_t parity; /* 0=none, 1=odd, 2=even */
|
||||
uint8_t bits; /* Number of bits (7 or 8) */
|
||||
@@ -108,31 +107,7 @@ static int up_setup(struct uart_dev_s *dev);
|
||||
static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
static int uart_interrupt(struct uart_dev_s *dev);
|
||||
#ifdef CONFIG_A1X_UART0
|
||||
static int uart0_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_A1X_UART1
|
||||
static int uart1_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_A1X_UART2
|
||||
static int uart2_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_A1X_UART3
|
||||
static int uart3_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_A1X_UART4
|
||||
static int uart4_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_A1X_UART5
|
||||
static int uart5_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_A1X_UART6
|
||||
static int uart6_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_A1X_UART7
|
||||
static int uart7_interrupt(int irq, void *context);
|
||||
#endif
|
||||
static int uart_interrupt(int irq, void *context, void *arg);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int up_receive(struct uart_dev_s *dev, uint32_t *status);
|
||||
static void up_rxint(struct uart_dev_s *dev, bool enable);
|
||||
@@ -214,7 +189,6 @@ static struct up_dev_s g_uart0priv =
|
||||
{
|
||||
.uartbase = A1X_UART0_VADDR,
|
||||
.baud = CONFIG_UART0_BAUD,
|
||||
.handler = uart0_interrupt,
|
||||
.irq = A1X_IRQ_UART0,
|
||||
.parity = CONFIG_UART0_PARITY,
|
||||
.bits = CONFIG_UART0_BITS,
|
||||
@@ -245,7 +219,6 @@ static struct up_dev_s g_uart1priv =
|
||||
{
|
||||
.uartbase = A1X_UART1_VADDR,
|
||||
.baud = CONFIG_UART1_BAUD,
|
||||
.handler = uart1_interrupt,
|
||||
.irq = A1X_IRQ_UART1,
|
||||
.parity = CONFIG_UART1_PARITY,
|
||||
.bits = CONFIG_UART1_BITS,
|
||||
@@ -276,7 +249,6 @@ static struct up_dev_s g_uart2priv =
|
||||
{
|
||||
.uartbase = A1X_UART2_VADDR,
|
||||
.baud = CONFIG_UART2_BAUD,
|
||||
.handler = uart2_interrupt,
|
||||
.irq = A1X_IRQ_UART2,
|
||||
.parity = CONFIG_UART2_PARITY,
|
||||
.bits = CONFIG_UART2_BITS,
|
||||
@@ -307,7 +279,6 @@ static struct up_dev_s g_uart3priv =
|
||||
{
|
||||
.uartbase = A1X_UART3_VADDR,
|
||||
.baud = CONFIG_UART3_BAUD,
|
||||
.handler = uart3_interrupt,
|
||||
.irq = A1X_IRQ_UART3,
|
||||
.parity = CONFIG_UART3_PARITY,
|
||||
.bits = CONFIG_UART3_BITS,
|
||||
@@ -338,7 +309,6 @@ static struct up_dev_s g_uart4priv =
|
||||
{
|
||||
.uartbase = A1X_UART4_VADDR,
|
||||
.baud = CONFIG_UART4_BAUD,
|
||||
.handler = uart4_interrupt,
|
||||
.irq = A1X_IRQ_UART4,
|
||||
.parity = CONFIG_UART4_PARITY,
|
||||
.bits = CONFIG_UART4_BITS,
|
||||
@@ -369,7 +339,6 @@ static struct up_dev_s g_uart5priv =
|
||||
{
|
||||
.uartbase = A1X_UART5_VADDR,
|
||||
.baud = CONFIG_UART5_BAUD,
|
||||
.handler = uart5_interrupt,
|
||||
.irq = A1X_IRQ_UART5,
|
||||
.parity = CONFIG_UART5_PARITY,
|
||||
.bits = CONFIG_UART5_BITS,
|
||||
@@ -400,7 +369,6 @@ static struct up_dev_s g_uart6priv =
|
||||
{
|
||||
.uartbase = A1X_UART6_VADDR,
|
||||
.baud = CONFIG_UART6_BAUD,
|
||||
.handler = uart6_interrupt,
|
||||
.irq = A1X_IRQ_UART6,
|
||||
.parity = CONFIG_UART6_PARITY,
|
||||
.bits = CONFIG_UART6_BITS,
|
||||
@@ -431,7 +399,6 @@ static struct up_dev_s g_uart7priv =
|
||||
{
|
||||
.uartbase = A1X_UART7_VADDR,
|
||||
.baud = CONFIG_UART7_BAUD,
|
||||
.handler = uart7_interrupt,
|
||||
.irq = A1X_IRQ_UART7,
|
||||
.parity = CONFIG_UART7_PARITY,
|
||||
.bits = CONFIG_UART7_BITS,
|
||||
@@ -1068,7 +1035,7 @@ static int up_attach(struct uart_dev_s *dev)
|
||||
|
||||
/* Attach and enable the IRQ */
|
||||
|
||||
ret = irq_attach(priv->irq, priv->handler);
|
||||
ret = irq_attach(priv->irq, uart_interrupt, priv);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable the interrupt (RX and TX interrupts are still disabled
|
||||
@@ -1110,12 +1077,14 @@ static void up_detach(struct uart_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int uart_interrupt(struct uart_dev_s *dev)
|
||||
static int uart_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct up_dev_s *priv;
|
||||
uint32_t status;
|
||||
int passes;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct up_dev_s *priv = (struct up_dev_s *)arg;
|
||||
uint32_t status;
|
||||
int passes;
|
||||
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
priv = (struct up_dev_s *)dev->priv;
|
||||
|
||||
/* Loop until there are no characters to be transferred or,
|
||||
@@ -1201,62 +1170,6 @@ static int uart_interrupt(struct uart_dev_s *dev)
|
||||
return OK;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_A1X_UART0
|
||||
static int uart0_interrupt(int irq, void *context)
|
||||
{
|
||||
return uart_interrupt(&g_uart0port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_A1X_UART1
|
||||
static int uart1_interrupt(int irq, void *context)
|
||||
{
|
||||
return uart_interrupt(&g_uart1port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_A1X_UART2
|
||||
static int uart2_interrupt(int irq, void *context)
|
||||
{
|
||||
return uart_interrupt(&g_uart2port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_A1X_UART3
|
||||
static int uart3_interrupt(int irq, void *context)
|
||||
{
|
||||
return uart_interrupt(&g_uart3port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_A1X_UART4
|
||||
static int uart4_interrupt(int irq, void *context)
|
||||
{
|
||||
return uart_interrupt(&g_uart4port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_A1X_UART5
|
||||
static int uart5_interrupt(int irq, void *context)
|
||||
{
|
||||
return uart_interrupt(&g_uart5port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_A1X_UART6
|
||||
static int uart6_interrupt(int irq, void *context)
|
||||
{
|
||||
return uart_interrupt(&g_uart6port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_A1X_UART7
|
||||
static int uart7_interrupt(int irq, void *context)
|
||||
{
|
||||
return uart_interrupt(&g_uart7port);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_ioctl
|
||||
*
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int a1x_timerisr(int irq, uint32_t *regs)
|
||||
static int a1x_timerisr(int irq, uint32_t *regs, void *arg)
|
||||
{
|
||||
/* Only a TIMER0 interrupt is expected here */
|
||||
|
||||
@@ -138,7 +138,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(A1X_IRQ_TIMER0, (xcpt_t)a1x_timerisr);
|
||||
(void)irq_attach(A1X_IRQ_TIMER0, (xcpt_t)a1x_timerisr, NULL);
|
||||
|
||||
/* Enable interrupts from the TIMER 0 port */
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_hardfault(int irq, FAR void *context)
|
||||
int up_hardfault(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
|
||||
@@ -115,7 +115,7 @@ int up_hardfault(int irq, FAR void *context)
|
||||
if (insn == INSN_SVC0)
|
||||
{
|
||||
hfinfo("Forward SVCall\n");
|
||||
return up_svcall(irq, context);
|
||||
return up_svcall(irq, context, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ static void dispatch_syscall(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_svcall(int irq, FAR void *context)
|
||||
int up_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
uint32_t cmd;
|
||||
|
||||
@@ -202,7 +202,7 @@ int up_cpu_paused(int cpu)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_pause_handler(int irq, FAR void *context)
|
||||
int arm_pause_handler(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
int cpu = this_cpu();
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ static inline void arm_registerdump(FAR struct tcb_s *tcb)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_start_handler(int irq, FAR void *context)
|
||||
int arm_start_handler(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
|
||||
|
||||
@@ -124,8 +124,8 @@ void arm_gic0_initialize(void)
|
||||
#ifdef CONFIG_SMP
|
||||
/* Attach SGI interrupt handlers. This attaches the handler for all CPUs. */
|
||||
|
||||
DEBUGVERIFY(irq_attach(GIC_IRQ_SGI1, arm_start_handler));
|
||||
DEBUGVERIFY(irq_attach(GIC_IRQ_SGI2, arm_pause_handler));
|
||||
DEBUGVERIFY(irq_attach(GIC_IRQ_SGI1, arm_start_handler, NULL));
|
||||
DEBUGVERIFY(irq_attach(GIC_IRQ_SGI2, arm_pause_handler, NULL));
|
||||
#endif
|
||||
|
||||
arm_gic_dump("Exit arm_gic0_initialize", true, 0);
|
||||
|
||||
@@ -759,7 +759,7 @@ uint32_t *arm_decodeirq(uint32_t *regs);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
int arm_start_handler(int irq, FAR void *context);
|
||||
int arm_start_handler(int irq, FAR void *context, FAR void *arg);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -783,7 +783,7 @@ int arm_start_handler(int irq, FAR void *context);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
int arm_pause_handler(int irq, FAR void *context);
|
||||
int arm_pause_handler(int irq, FAR void *context, FAR void *arg);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_hardfault(int irq, FAR void *context)
|
||||
int up_hardfault(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG_HARDFAULT) || !defined(CONFIG_ARMV7M_USEBASEPRI)
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
@@ -124,7 +124,7 @@ int up_hardfault(int irq, FAR void *context)
|
||||
if (insn == INSN_SVC0)
|
||||
{
|
||||
hfalert("Forward SVCall\n");
|
||||
return up_svcall(irq, context);
|
||||
return up_svcall(irq, context, arg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_memfault(int irq, FAR void *context)
|
||||
int up_memfault(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
/* Dump some memory management fault info */
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ static void dispatch_syscall(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_svcall(int irq, FAR void *context)
|
||||
int up_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
uint32_t cmd;
|
||||
|
||||
@@ -401,7 +401,7 @@ static void c5471_txstatus(struct c5471_driver_s *priv);
|
||||
static void c5471_txdone(struct c5471_driver_s *priv);
|
||||
|
||||
static void c5471_interrupt_work(FAR void *arg);
|
||||
static int c5471_interrupt(int irq, FAR void *context);
|
||||
static int c5471_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
|
||||
/* Watchdog timer expirations */
|
||||
|
||||
@@ -1634,7 +1634,7 @@ static void c5471_interrupt_work(FAR void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int c5471_interrupt(int irq, FAR void *context)
|
||||
static int c5471_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
#if CONFIG_C5471_NET_NINTERFACES == 1
|
||||
register struct c5471_driver_s *priv = &g_c5471[0];
|
||||
@@ -2449,7 +2449,7 @@ void up_netinitialize(void)
|
||||
{
|
||||
/* Attach the IRQ to the driver */
|
||||
|
||||
if (irq_attach(C5471_IRQ_ETHER, c5471_interrupt))
|
||||
if (irq_attach(C5471_IRQ_ETHER, c5471_interrupt, NULL))
|
||||
{
|
||||
/* We could not attach the ISR to the ISR */
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ static int up_setup(struct uart_dev_s *dev);
|
||||
static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
static int up_interrupt(int irq, void *context);
|
||||
static int up_interrupt(int irq, void *context, void *arg);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int up_receive(struct uart_dev_s *dev, unsigned int *status);
|
||||
static void up_rxint(struct uart_dev_s *dev, bool enable);
|
||||
@@ -491,7 +491,7 @@ static int up_attach(struct uart_dev_s *dev)
|
||||
|
||||
/* Attach and enable the IRQ */
|
||||
|
||||
ret = irq_attach(priv->irq, up_interrupt);
|
||||
ret = irq_attach(priv->irq, up_interrupt, dev);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable the interrupt (RX and TX interrupts are still disabled
|
||||
@@ -534,24 +534,13 @@ static void up_detach(struct uart_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_interrupt(int irq, void *context)
|
||||
static int up_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct uart_dev_s *dev = NULL;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct up_dev_s *priv;
|
||||
volatile uint32_t cause;
|
||||
|
||||
if (g_irdapriv.irq == irq)
|
||||
{
|
||||
dev = &g_irdaport;
|
||||
}
|
||||
else if (g_modempriv.irq == irq)
|
||||
{
|
||||
dev = &g_modemport;
|
||||
}
|
||||
else
|
||||
{
|
||||
PANIC();
|
||||
}
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
priv = (struct up_dev_s *)dev->priv;
|
||||
|
||||
cause = up_inserial(priv, UART_ISR_OFFS) & 0x0000003f;
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int c5471_timerisr(int irq, uint32_t *regs)
|
||||
static int c5471_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@@ -118,6 +118,6 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt */
|
||||
|
||||
irq_attach(C5471_IRQ_SYSTIMER, (xcpt_t)c5471_timerisr);
|
||||
irq_attach(C5471_IRQ_SYSTIMER, (xcpt_t)c5471_timerisr, NULL);
|
||||
up_enable_irq(C5471_IRQ_SYSTIMER);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
static inline unsigned int wdt_prescaletoptv(unsigned int prescale);
|
||||
|
||||
static int wdt_setusec(uint32_t usec);
|
||||
static int wdt_interrupt(int irq, void *context);
|
||||
static int wdt_interrupt(int irq, void *context, FAR void *arg);
|
||||
|
||||
static int wdt_open(struct file *filep);
|
||||
static int wdt_close(struct file *filep);
|
||||
@@ -232,7 +232,7 @@ static int wdt_setusec(uint32_t usec)
|
||||
* Name: wdt_interrupt
|
||||
****************************************************************************/
|
||||
|
||||
static int wdt_interrupt(int irq, void *context)
|
||||
static int wdt_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
wdinfo("expired\n");
|
||||
|
||||
@@ -382,7 +382,7 @@ int up_wdtinit(void)
|
||||
|
||||
/* Request the interrupt. */
|
||||
|
||||
ret = irq_attach(C5471_IRQ_WATCHDOG, wdt_interrupt);
|
||||
ret = irq_attach(C5471_IRQ_WATCHDOG, wdt_interrupt, NULL);
|
||||
if (ret)
|
||||
{
|
||||
unregister_driver("/dev/wdt");
|
||||
|
||||
@@ -374,13 +374,13 @@ uint32_t *up_doirq(int irq, uint32_t *regs);
|
||||
|
||||
/* Exception Handlers */
|
||||
|
||||
int up_svcall(int irq, FAR void *context);
|
||||
int up_hardfault(int irq, FAR void *context);
|
||||
int up_svcall(int irq, FAR void *context, FAR void *arg);
|
||||
int up_hardfault(int irq, FAR void *context, FAR void *arg);
|
||||
|
||||
# if defined(CONFIG_ARCH_CORTEXM3) || defined(CONFIG_ARCH_CORTEXM4) || \
|
||||
defined(CONFIG_ARCH_CORTEXM7)
|
||||
|
||||
int up_memfault(int irq, FAR void *context);
|
||||
int up_memfault(int irq, FAR void *context, FAR void *arg);
|
||||
|
||||
# endif /* CONFIG_ARCH_CORTEXM3,4,7 */
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/dm320/dm320_serial.c
|
||||
* arch/arm/src/chip/dm320_serial.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2012-2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2012-2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -89,7 +88,7 @@ static int up_setup(struct uart_dev_s *dev);
|
||||
static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
static int up_interrupt(int irq, void *context);
|
||||
static int up_interrupt(int irq, void *context, void *arg);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int up_receive(struct uart_dev_s *dev, uint32_t *status);
|
||||
static void up_rxint(struct uart_dev_s *dev, bool enable);
|
||||
@@ -430,7 +429,7 @@ static int up_attach(struct uart_dev_s *dev)
|
||||
|
||||
/* Attach and enable the IRQ */
|
||||
|
||||
ret = irq_attach(priv->irq, up_interrupt);
|
||||
ret = irq_attach(priv->irq, up_interrupt, dev);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable the interrupt (RX and TX interrupts are still disabled
|
||||
@@ -472,25 +471,14 @@ static void up_detach(struct uart_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_interrupt(int irq, void *context)
|
||||
static int up_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct uart_dev_s *dev = NULL;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct up_dev_s *priv;
|
||||
uint16_t status;
|
||||
int passes = 0;
|
||||
|
||||
if (g_uart1priv.irq == irq)
|
||||
{
|
||||
dev = &g_uart1port;
|
||||
}
|
||||
else if (g_uart0priv.irq == irq)
|
||||
{
|
||||
dev = &g_uart0port;
|
||||
}
|
||||
else
|
||||
{
|
||||
PANIC();
|
||||
}
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
priv = (struct up_dev_s *)dev->priv;
|
||||
|
||||
/* Loop until there are no characters to be transferred or,
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_timerisr(int irq, uint32_t *regs)
|
||||
static int dm320_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@@ -147,7 +147,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt */
|
||||
|
||||
irq_attach(DM320_IRQ_SYSTIMER, (xcpt_t)dm320_timerisr);
|
||||
irq_attach(DM320_IRQ_SYSTIMER, (xcpt_t)dm320_timerisr, NULL);
|
||||
up_enable_irq(DM320_IRQ_SYSTIMER);
|
||||
}
|
||||
|
||||
|
||||
@@ -309,8 +309,8 @@ static void dm320_dispatchrequest(struct dm320_usbdev_s *priv,
|
||||
const struct usb_ctrlreq_s *ctrl);
|
||||
static inline void dm320_ep0setup(struct dm320_usbdev_s *priv);
|
||||
static inline uint32_t dm320_highestpriinterrupt(int intstatus);
|
||||
static int dm320_ctlrinterrupt(int irq, FAR void *context);
|
||||
static int dm320_attachinterrupt(int irq, FAR void *context);
|
||||
static int dm320_ctlrinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
static int dm320_attachinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
|
||||
/* Initialization operations */
|
||||
|
||||
@@ -1513,7 +1513,7 @@ static inline uint32_t dm320_highestpriinterrupt(int intstatus)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_ctlrinterrupt(int irq, FAR void *context)
|
||||
static int dm320_ctlrinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
struct dm320_usbdev_s *priv = &g_usbdev;
|
||||
struct dm320_ep_s *privep ;
|
||||
@@ -1680,7 +1680,7 @@ static int dm320_ctlrinterrupt(int irq, FAR void *context)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int dm320_attachinterrupt(int irq, FAR void *context)
|
||||
static int dm320_attachinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
struct dm320_usbdev_s *priv = &g_usbdev;
|
||||
uint16_t gio;
|
||||
@@ -2438,7 +2438,7 @@ void up_usbinitialize(void)
|
||||
|
||||
/* Attach host attach GIO interrupt */
|
||||
|
||||
if (irq_attach(IRQ_USBATTACH, dm320_attachinterrupt) != 0)
|
||||
if (irq_attach(IRQ_USBATTACH, dm320_attachinterrupt, NULL) != 0)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(DM320_TRACEERR_ATTACHIRQREG), 0);
|
||||
goto errout;
|
||||
@@ -2448,7 +2448,7 @@ void up_usbinitialize(void)
|
||||
* enabled when the driver is bound
|
||||
*/
|
||||
|
||||
if (irq_attach(DM320_IRQ_USB1, dm320_ctlrinterrupt) != 0)
|
||||
if (irq_attach(DM320_IRQ_USB1, dm320_ctlrinterrupt, NULL) != 0)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(DM320_TRACEERR_COREIRQREG), 0);
|
||||
goto errout;
|
||||
|
||||
@@ -123,7 +123,7 @@ static void adc_hw_reset(struct efm32_dev_s *priv, bool reset);
|
||||
|
||||
/* ADC Interrupt Handler */
|
||||
|
||||
static int adc_interrupt(FAR struct adc_dev_s *dev);
|
||||
static int adc_interrupt(int irq, FAR void * context, FAR struct adc_dev_s *dev);
|
||||
|
||||
/* ADC Driver Methods */
|
||||
|
||||
@@ -1072,7 +1072,7 @@ static int adc_setup(FAR struct adc_dev_s *dev)
|
||||
|
||||
/* Attach the ADC interrupt */
|
||||
|
||||
ret = irq_attach(priv->irq, priv->isr);
|
||||
ret = irq_attach(priv->irq, priv->isr, dev);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Make sure that the ADC device is in the powered up, reset state */
|
||||
@@ -1180,7 +1180,7 @@ static int adc_ioctl(FAR struct adc_dev_s *dev, int cmd, unsigned long arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int adc_interrupt(FAR struct adc_dev_s *dev)
|
||||
static int adc_interrupt(int irq, FAR void * context, FAR struct adc_dev_s *dev)
|
||||
{
|
||||
FAR struct efm32_dev_s *priv = (FAR struct efm32_dev_s *)dev->ad_priv;
|
||||
uint32_t adcsr;
|
||||
|
||||
@@ -204,7 +204,7 @@ efm32_get_descriptor(struct dma_channel_s *dmach, bool alt)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_dmac_interrupt(int irq, void *context)
|
||||
static int efm32_dmac_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
struct dma_channel_s *dmach;
|
||||
unsigned int chndx;
|
||||
@@ -297,7 +297,7 @@ void weak_function up_dmainitialize(void)
|
||||
|
||||
/* Attach DMA interrupt vector */
|
||||
|
||||
(void)irq_attach(EFM32_IRQ_DMA, efm32_dmac_interrupt);
|
||||
(void)irq_attach(EFM32_IRQ_DMA, efm32_dmac_interrupt, NULL);
|
||||
|
||||
/* Enable the DMA controller */
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ static int efm32_gpio_interrupt(uint32_t mask, void *context)
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static int efm32_even_interrupt(int irq, void *context)
|
||||
static int efm32_even_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_gpio_interrupt(0x00005555, context);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ static int efm32_even_interrupt(int irq, void *context)
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static int efm32_odd_interrupt(int irq, void *context)
|
||||
static int efm32_odd_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_gpio_interrupt(0x0000aaaa, context);
|
||||
}
|
||||
@@ -173,8 +173,8 @@ void efm32_gpioirqinitialize(void)
|
||||
|
||||
/* Attach the even and odd interrupt handlers */
|
||||
|
||||
DEBUGVERIFY(irq_attach(EFM32_IRQ_GPIO_EVEN, efm32_even_interrupt));
|
||||
DEBUGVERIFY(irq_attach(EFM32_IRQ_GPIO_ODD, efm32_odd_interrupt));
|
||||
DEBUGVERIFY(irq_attach(EFM32_IRQ_GPIO_EVEN, efm32_even_interrupt, NULL));
|
||||
DEBUGVERIFY(irq_attach(EFM32_IRQ_GPIO_ODD, efm32_odd_interrupt, NULL));
|
||||
|
||||
/* Enable GPIO even and odd interrupts at the NVIC */
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ struct efm32_i2c_config_s
|
||||
uint32_t scl_pin; /* GPIO configuration for SCL as SCL */
|
||||
uint32_t sda_pin; /* GPIO configuration for SDA as SDA */
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
int (*isr) (int, void *); /* Interrupt handler */
|
||||
int (*isr) (int, void *, void *); /* Interrupt handler */
|
||||
uint32_t irq; /* Event IRQ */
|
||||
#endif
|
||||
};
|
||||
@@ -298,10 +298,10 @@ static int efm32_i2c_isr(struct efm32_i2c_priv_s *priv);
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
#ifdef CONFIG_EFM32_I2C0
|
||||
static int efm32_i2c0_isr(int irq, void *context);
|
||||
static int efm32_i2c0_isr(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#ifdef CONFIG_EFM32_I2C1
|
||||
static int efm32_i2c1_isr(int irq, void *context);
|
||||
static int efm32_i2c1_isr(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#endif /* !CONFIG_I2C_POLLED */
|
||||
|
||||
@@ -1290,7 +1290,7 @@ done:
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EFM32_I2C0
|
||||
static int efm32_i2c0_isr(int irq, void *context)
|
||||
static int efm32_i2c0_isr(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_i2c_isr(&efm32_i2c0_priv);
|
||||
}
|
||||
@@ -1305,7 +1305,7 @@ static int efm32_i2c0_isr(int irq, void *context)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EFM32_I2C1
|
||||
static int efm32_i2c1_isr(int irq, void *context)
|
||||
static int efm32_i2c1_isr(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_i2c_isr(&efm32_i2c1_priv);
|
||||
}
|
||||
@@ -1389,7 +1389,7 @@ static int efm32_i2c_init(FAR struct efm32_i2c_priv_s *priv)
|
||||
/* Attach ISRs */
|
||||
|
||||
#ifndef CONFIG_I2C_POLLED
|
||||
irq_attach(priv->config->irq, priv->config->isr);
|
||||
irq_attach(priv->config->irq, priv->config->isr, NULL);
|
||||
up_enable_irq(priv->config->irq);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ static void efm32_dumpnvic(const char *msg, int irq)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int efm32_nmi(int irq, FAR void *context)
|
||||
static int efm32_nmi(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! NMI received\n");
|
||||
@@ -171,7 +171,7 @@ static int efm32_nmi(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_busfault(int irq, FAR void *context)
|
||||
static int efm32_busfault(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS));
|
||||
@@ -179,7 +179,7 @@ static int efm32_busfault(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_usagefault(int irq, FAR void *context)
|
||||
static int efm32_usagefault(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS));
|
||||
@@ -187,7 +187,7 @@ static int efm32_usagefault(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_pendsv(int irq, FAR void *context)
|
||||
static int efm32_pendsv(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! PendSV received\n");
|
||||
@@ -195,7 +195,7 @@ static int efm32_pendsv(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_dbgmonitor(int irq, FAR void *context)
|
||||
static int efm32_dbgmonitor(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Debug Monitor received\n");
|
||||
@@ -203,7 +203,7 @@ static int efm32_dbgmonitor(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int efm32_reserved(int irq, FAR void *context)
|
||||
static int efm32_reserved(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Reserved interrupt\n");
|
||||
@@ -382,8 +382,8 @@ void up_irqinitialize(void)
|
||||
* under certain conditions.
|
||||
*/
|
||||
|
||||
irq_attach(EFM32_IRQ_SVCALL, up_svcall);
|
||||
irq_attach(EFM32_IRQ_HARDFAULT, up_hardfault);
|
||||
irq_attach(EFM32_IRQ_SVCALL, up_svcall, NULL);
|
||||
irq_attach(EFM32_IRQ_HARDFAULT, up_hardfault, NULL);
|
||||
|
||||
/* Set the priority of the SVCall interrupt */
|
||||
|
||||
@@ -396,22 +396,22 @@ void up_irqinitialize(void)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARM_MPU
|
||||
irq_attach(EFM32_IRQ_MEMFAULT, up_memfault);
|
||||
irq_attach(EFM32_IRQ_MEMFAULT, up_memfault, NULL);
|
||||
up_enable_irq(EFM32_IRQ_MEMFAULT);
|
||||
#endif
|
||||
|
||||
/* Attach all other processor exceptions (except reset and sys tick) */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
irq_attach(EFM32_IRQ_NMI, efm32_nmi);
|
||||
irq_attach(EFM32_IRQ_NMI, efm32_nmi, NULL);
|
||||
#ifndef CONFIG_ARM_MPU
|
||||
irq_attach(EFM32_IRQ_MEMFAULT, up_memfault);
|
||||
irq_attach(EFM32_IRQ_MEMFAULT, up_memfault, NULL);
|
||||
#endif
|
||||
irq_attach(EFM32_IRQ_BUSFAULT, efm32_busfault);
|
||||
irq_attach(EFM32_IRQ_USAGEFAULT, efm32_usagefault);
|
||||
irq_attach(EFM32_IRQ_PENDSV, efm32_pendsv);
|
||||
irq_attach(EFM32_IRQ_DBGMONITOR, efm32_dbgmonitor);
|
||||
irq_attach(EFM32_IRQ_RESERVED, efm32_reserved);
|
||||
irq_attach(EFM32_IRQ_BUSFAULT, efm32_busfault, NULL);
|
||||
irq_attach(EFM32_IRQ_USAGEFAULT, efm32_usagefault, NULL);
|
||||
irq_attach(EFM32_IRQ_PENDSV, efm32_pendsv, NULL);
|
||||
irq_attach(EFM32_IRQ_DBGMONITOR, efm32_dbgmonitor, NULL);
|
||||
irq_attach(EFM32_IRQ_RESERVED, efm32_reserved, NULL);
|
||||
#endif
|
||||
|
||||
efm32_dumpnvic("initial", NR_VECTORS);
|
||||
|
||||
@@ -134,7 +134,6 @@
|
||||
struct efm32_config_s
|
||||
{
|
||||
uintptr_t uartbase; /* Base address of UART registers */
|
||||
xcpt_t handler; /* Interrupt handler */
|
||||
uint32_t baud; /* Configured baud */
|
||||
uint8_t irq; /* IRQ associated with this LEUART (for enable) */
|
||||
uint8_t parity; /* 0=none, 1=odd, 2=even */
|
||||
@@ -163,13 +162,7 @@ static int efm32_setup(struct uart_dev_s *dev);
|
||||
static void efm32_shutdown(struct uart_dev_s *dev);
|
||||
static int efm32_attach(struct uart_dev_s *dev);
|
||||
static void efm32_detach(struct uart_dev_s *dev);
|
||||
static int efm32_interrupt(struct uart_dev_s *dev);
|
||||
#if defined(CONFIG_EFM32_LEUART0)
|
||||
static int efm32_leuart0_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_LEUART1)
|
||||
static int efm32_leuart1_interrupt(int irq, void *context);
|
||||
#endif
|
||||
static int efm32_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int efm32_receive(struct uart_dev_s *dev, uint32_t *status);
|
||||
static void efm32_rxint(struct uart_dev_s *dev, bool enable);
|
||||
@@ -219,7 +212,6 @@ static char g_leuart1txbuffer[CONFIG_LEUART1_TXBUFSIZE];
|
||||
static const struct efm32_config_s g_leuart0config =
|
||||
{
|
||||
.uartbase = EFM32_LEUART0_BASE,
|
||||
.handler = efm32_leuart0_interrupt,
|
||||
.baud = CONFIG_LEUART0_BAUD,
|
||||
.irq = EFM32_IRQ_LEUART0,
|
||||
.parity = CONFIG_LEUART0_PARITY,
|
||||
@@ -255,7 +247,6 @@ static struct uart_dev_s g_leuart0port =
|
||||
static struct efm32_config_s g_leuart1config =
|
||||
{
|
||||
.uartbase = EFM32_LEUART1_BASE,
|
||||
.handler = efm32_leuart1_interrupt,
|
||||
.baud = CONFIG_LEUART1_BAUD,
|
||||
.irq = EFM32_IRQ_LEUART1,
|
||||
.parity = CONFIG_LEUART1_PARITY,
|
||||
@@ -429,7 +420,7 @@ static int efm32_attach(struct uart_dev_s *dev)
|
||||
* disabled in the C2 register.
|
||||
*/
|
||||
|
||||
ret = irq_attach(config->irq, config->handler);
|
||||
ret = irq_attach(config->irq, efm32_interrupt, dev);
|
||||
if (ret >= 0)
|
||||
{
|
||||
up_enable_irq(config->irq);
|
||||
@@ -471,12 +462,14 @@ static void efm32_detach(struct uart_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_interrupt(struct uart_dev_s *dev)
|
||||
static int efm32_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
struct efm32_leuart_s *priv = (struct efm32_leuart_s *)dev->priv;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct efm32_leuart_s *priv;
|
||||
uint32_t intflags;
|
||||
|
||||
DEBUGASSERT(priv);
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
priv = (struct efm32_leuart_s *)dev->priv;
|
||||
|
||||
/* Read the interrupt flags register */
|
||||
|
||||
@@ -534,20 +527,6 @@ static int efm32_interrupt(struct uart_dev_s *dev)
|
||||
return OK;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_EFM32_LEUART0)
|
||||
static int efm32_leuart0_interrupt(int irq, void *context)
|
||||
{
|
||||
return efm32_interrupt(&g_leuart0port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_LEUART1)
|
||||
static int efm32_leuart1_interrupt(int irq, void *context)
|
||||
{
|
||||
return efm32_interrupt(&g_leuart1port);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: efm32_ioctl
|
||||
*
|
||||
|
||||
@@ -133,19 +133,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv,
|
||||
defined(CONFIG_EFM32_TIMER2_PWM) || \
|
||||
defined(CONFIG_EFM32_TIMER3_PWM) \
|
||||
)
|
||||
static int pwm_interrupt(struct efm32_pwmtimer_s *priv);
|
||||
#if defined(CONFIG_EFM32_TIMER0_PWM)
|
||||
static int pwm_timer0_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_TIMER1_PWM)
|
||||
static int pwm_timer1_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_TIMER2_PWM)
|
||||
static int pwm_timer2_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_TIMER3_PWM)
|
||||
static int pwm_timer3_interrupt(int irq, void *context);
|
||||
#endif
|
||||
static int pwm_interrupt(int irq, void *context, FAR void *arg);
|
||||
static uint8_t pwm_pulsecount(uint32_t count);
|
||||
|
||||
#endif
|
||||
@@ -446,7 +434,7 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv,
|
||||
* Handle timer interrupts.
|
||||
*
|
||||
* Input parameters:
|
||||
* priv - A reference to the lower half PWM driver state structure
|
||||
* Standard interrupt handler arguments.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero on success; a negated errno value on failure
|
||||
@@ -459,12 +447,15 @@ static int pwm_timer(FAR struct efm32_pwmtimer_s *priv,
|
||||
defined(CONFIG_EFM32_TIMER3_PWM) \
|
||||
)
|
||||
#warning "not yet implemented"
|
||||
static int pwm_interrupt(struct efm32_pwmtimer_s *priv)
|
||||
static int pwm_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
/* TODO pwm_interrupt */
|
||||
#if 0
|
||||
struct efm32_pwmtimer_s *priv = (struct efm32_pwmtimer_s *)arg;
|
||||
uint32_t regval;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
||||
/* Verify that this is an update interrupt. Nothing else is expected. */
|
||||
|
||||
regval = pwm_getreg(priv, STM32_ATIM_SR_OFFSET);
|
||||
@@ -532,48 +523,6 @@ static int pwm_interrupt(struct efm32_pwmtimer_s *priv)
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pwm_timer1/3_interrupt
|
||||
*
|
||||
* Description:
|
||||
* Handle timer 1..3 interrupts.
|
||||
*
|
||||
* Input parameters:
|
||||
* Standard NuttX interrupt inputs
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero on success; a negated errno value on failure
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_EFM32_TIMER0_PWM)
|
||||
static int pwm_timer0_interrupt(int irq, void *context)
|
||||
{
|
||||
return pwm_interrupt(&g_pwm0dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_EFM32_TIMER1_PWM)
|
||||
static int pwm_timer1_interrupt(int irq, void *context)
|
||||
{
|
||||
return pwm_interrupt(&g_pwm1dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_EFM32_TIMER2_PWM)
|
||||
static int pwm_timer2_interrupt(int irq, void *context)
|
||||
{
|
||||
return pwm_interrupt(&g_pwm2dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PWM_PULSECOUNT) && defined(CONFIG_EFM32_TIMER3_PWM)
|
||||
static int pwm_timer3_interrupt(int irq, void *context)
|
||||
{
|
||||
return pwm_interrupt(&g_pwm3dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pwm_pulsecount
|
||||
*
|
||||
@@ -866,50 +815,22 @@ FAR struct pwm_lowerhalf_s *efm32_pwminitialize(int timer)
|
||||
#ifdef CONFIG_EFM32_TIMER0_PWM
|
||||
case 0:
|
||||
lower = &g_pwm0dev;
|
||||
|
||||
/* Attach but disable the TIM1 update interrupt */
|
||||
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
irq_attach(lower->irq, pwm_timer0_interrupt);
|
||||
up_disable_irq(lower->irq);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EFM32_TIMER1_PWM
|
||||
case 1:
|
||||
lower = &g_pwm1dev;
|
||||
|
||||
/* Attach but disable the TIM1 update interrupt */
|
||||
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
irq_attach(lower->irq, pwm_timer0_interrupt);
|
||||
up_disable_irq(lower->irq);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_EFM32_TIMER2_PWM
|
||||
case 2:
|
||||
lower = &g_pwm2dev;
|
||||
|
||||
/* Attach but disable the TIM1 update interrupt */
|
||||
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
irq_attach(lower->irq, pwm_timer2_interrupt);
|
||||
up_disable_irq(lower->irq);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_EFM32_TIMER3_PWM
|
||||
case 3:
|
||||
lower = &g_pwm3dev;
|
||||
|
||||
/* Attach but disable the TIM1 update interrupt */
|
||||
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
irq_attach(lower->irq, pwm_timer3_interrupt);
|
||||
up_disable_irq(lower->irq);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -918,6 +839,13 @@ FAR struct pwm_lowerhalf_s *efm32_pwminitialize(int timer)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Attach but disable the timer update interrupt */
|
||||
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
irq_attach(lower->irq, pwm_interrupt, lower);
|
||||
up_disable_irq(lower->irq);
|
||||
#endif
|
||||
|
||||
return (FAR struct pwm_lowerhalf_s *)lower;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ volatile bool g_rtc_enabled = false;
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static int efm32_rtc_burtc_interrupt(int irq, void *context)
|
||||
static int efm32_rtc_burtc_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
uint32_t source = getreg32(EFM32_BURTC_IF);
|
||||
|
||||
@@ -378,7 +378,7 @@ int up_rtc_initialize(void)
|
||||
|
||||
/* Configure RTC interrupt to catch overflow and alarm interrupts. */
|
||||
|
||||
irq_attach(EFM32_IRQ_BURTC, efm32_rtc_burtc_interrupt);
|
||||
irq_attach(EFM32_IRQ_BURTC, efm32_rtc_burtc_interrupt, NULL);
|
||||
up_enable_irq(EFM32_IRQ_BURTC);
|
||||
|
||||
g_rtc_enabled = true;
|
||||
|
||||
@@ -259,35 +259,35 @@ static int efm32_attach(struct uart_dev_s *dev);
|
||||
static void efm32_detach(struct uart_dev_s *dev);
|
||||
static int efm32_rxinterrupt(struct uart_dev_s *dev);
|
||||
#if defined(CONFIG_EFM32_USART0_ISUART)
|
||||
static int efm32_usart0_rxinterrupt(int irq, void *context);
|
||||
static int efm32_usart0_rxinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_USART1_ISUART)
|
||||
static int efm32_usart1_rxinterrupt(int irq, void *context);
|
||||
static int efm32_usart1_rxinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_USART2_ISUART)
|
||||
static int efm32_usart2_rxinterrupt(int irq, void *context);
|
||||
static int efm32_usart2_rxinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_UART0)
|
||||
static int efm32_uart0_rxinterrupt(int irq, void *context);
|
||||
static int efm32_uart0_rxinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_UART1)
|
||||
static int efm32_uart1_rxinterrupt(int irq, void *context);
|
||||
static int efm32_uart1_rxinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
static int efm32_txinterrupt(struct uart_dev_s *dev);
|
||||
#if defined(CONFIG_EFM32_USART0_ISUART)
|
||||
static int efm32_usart0_txinterrupt(int irq, void *context);
|
||||
static int efm32_usart0_txinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_USART1_ISUART)
|
||||
static int efm32_usart1_txinterrupt(int irq, void *context);
|
||||
static int efm32_usart1_txinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_USART2_ISUART)
|
||||
static int efm32_usart2_txinterrupt(int irq, void *context);
|
||||
static int efm32_usart2_txinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_UART0)
|
||||
static int efm32_uart0_txinterrupt(int irq, void *context);
|
||||
static int efm32_uart0_txinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
#if defined(CONFIG_EFM32_UART1)
|
||||
static int efm32_uart1_txinterrupt(int irq, void *context);
|
||||
static int efm32_uart1_txinterrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int efm32_receive(struct uart_dev_s *dev, uint32_t *status);
|
||||
@@ -689,13 +689,13 @@ static int efm32_attach(struct uart_dev_s *dev)
|
||||
* disabled in the C2 register.
|
||||
*/
|
||||
|
||||
ret = irq_attach(config->rxirq, config->rxhandler);
|
||||
ret = irq_attach(config->rxirq, config->rxhandler, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = irq_attach(config->txirq, config->txhandler);
|
||||
ret = irq_attach(config->txirq, config->txhandler, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
irq_detach(config->rxirq);
|
||||
@@ -788,35 +788,35 @@ static int efm32_rxinterrupt(struct uart_dev_s *dev)
|
||||
}
|
||||
|
||||
#if defined(CONFIG_EFM32_USART0_ISUART)
|
||||
static int efm32_usart0_rxinterrupt(int irq, void *context)
|
||||
static int efm32_usart0_rxinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_rxinterrupt(&g_usart0port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_USART1_ISUART)
|
||||
static int efm32_usart1_rxinterrupt(int irq, void *context)
|
||||
static int efm32_usart1_rxinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_rxinterrupt(&g_usart1port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_USART2_ISUART)
|
||||
static int efm32_usart2_rxinterrupt(int irq, void *context)
|
||||
static int efm32_usart2_rxinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_rxinterrupt(&g_usart2port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_UART0)
|
||||
static int efm32_uart0_rxinterrupt(int irq, void *context)
|
||||
static int efm32_uart0_rxinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_rxinterrupt(&g_uart0port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_UART1)
|
||||
static int efm32_uart1_rxinterrupt(int irq, void *context)
|
||||
static int efm32_uart1_rxinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_rxinterrupt(&g_uart1port);
|
||||
}
|
||||
@@ -871,35 +871,35 @@ static int efm32_txinterrupt(struct uart_dev_s *dev)
|
||||
}
|
||||
|
||||
#if defined(CONFIG_EFM32_USART0_ISUART)
|
||||
static int efm32_usart0_txinterrupt(int irq, void *context)
|
||||
static int efm32_usart0_txinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_txinterrupt(&g_usart0port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_USART1_ISUART)
|
||||
static int efm32_usart1_txinterrupt(int irq, void *context)
|
||||
static int efm32_usart1_txinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_txinterrupt(&g_usart1port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_USART2_ISUART)
|
||||
static int efm32_usart2_txinterrupt(int irq, void *context)
|
||||
static int efm32_usart2_txinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_txinterrupt(&g_usart2port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_UART0)
|
||||
static int efm32_uart0_txinterrupt(int irq, void *context)
|
||||
static int efm32_uart0_txinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_txinterrupt(&g_uart0port);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_EFM32_UART1)
|
||||
static int efm32_uart1_txinterrupt(int irq, void *context)
|
||||
static int efm32_uart1_txinterrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
return efm32_txinterrupt(&g_uart1port);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_timerisr(int irq, uint32_t *regs)
|
||||
static int efm32_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@@ -125,7 +125,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(EFM32_IRQ_SYSTICK, (xcpt_t)efm32_timerisr);
|
||||
(void)irq_attach(EFM32_IRQ_SYSTICK, (xcpt_t)efm32_timerisr, NULL);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
||||
@@ -574,7 +574,7 @@ static inline void efm32_otginterrupt(FAR struct efm32_usbdev_s *priv);
|
||||
|
||||
/* First level interrupt processing */
|
||||
|
||||
static int efm32_usbinterrupt(int irq, FAR void *context);
|
||||
static int efm32_usbinterrupt(int irq, FAR void *context, FAR void *arg);
|
||||
|
||||
/* Endpoint operations *********************************************************/
|
||||
/* Global OUT NAK controls */
|
||||
@@ -3498,7 +3498,7 @@ static inline void efm32_otginterrupt(FAR struct efm32_usbdev_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_usbinterrupt(int irq, FAR void *context)
|
||||
static int efm32_usbinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
/* At present, there is only a single OTG FS device support. Hence it is
|
||||
* pre-allocated as g_otgfsdev. However, in most code, the private data
|
||||
@@ -5485,7 +5485,7 @@ void up_usbinitialize(void)
|
||||
|
||||
/* Attach the OTG FS interrupt handler */
|
||||
|
||||
ret = irq_attach(EFM32_IRQ_USB, efm32_usbinterrupt);
|
||||
ret = irq_attach(EFM32_IRQ_USB, efm32_usbinterrupt, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
uerr("ERROR: irq_attach failed\n", ret);
|
||||
|
||||
@@ -417,7 +417,7 @@ static inline void efm32_gint_ipxfrisr(FAR struct efm32_usbhost_s *priv);
|
||||
|
||||
/* First level, global interrupt handler */
|
||||
|
||||
static int efm32_gint_isr(int irq, FAR void *context);
|
||||
static int efm32_gint_isr(int irq, FAR void *context, FAR void *arg);
|
||||
|
||||
/* Interrupt controls */
|
||||
|
||||
@@ -3495,7 +3495,7 @@ static inline void efm32_gint_ipxfrisr(FAR struct efm32_usbhost_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int efm32_gint_isr(int irq, FAR void *context)
|
||||
static int efm32_gint_isr(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
/* At present, there is only support for a single OTG FS host. Hence it is
|
||||
* pre-allocated as g_usbhost. However, in most code, the private data
|
||||
@@ -5374,7 +5374,7 @@ FAR struct usbhost_connection_s *efm32_usbhost_initialize(int controller)
|
||||
|
||||
/* Attach USB host controller interrupt handler */
|
||||
|
||||
if (irq_attach(EFM32_IRQ_USB, efm32_gint_isr) != 0)
|
||||
if (irq_attach(EFM32_IRQ_USB, efm32_gint_isr, NULL) != 0)
|
||||
{
|
||||
usbhost_trace1(USBHOST_TRACE1_IRQATTACH, 0);
|
||||
return NULL;
|
||||
|
||||
@@ -112,7 +112,7 @@ static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
static inline struct uart_dev_s *up_mapirq(int irq);
|
||||
static int up_interrupt(int irq, void *context);
|
||||
static int up_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int up_receive(struct uart_dev_s *dev, uint32_t *status);
|
||||
static void up_rxint(struct uart_dev_s *dev, bool enable);
|
||||
@@ -753,13 +753,13 @@ static int up_attach(struct uart_dev_s *dev)
|
||||
/* Attach and enable the IRQ */
|
||||
|
||||
#if defined(CONFIG_ARCH_CHIP_IMX1) || defined(CONFIG_ARCH_CHIP_IMXL)
|
||||
ret = irq_attach(priv->rxirq, up_interrupt);
|
||||
ret = irq_attach(priv->rxirq, up_interrupt, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = irq_attach(priv->txirq, up_interrupt);
|
||||
ret = irq_attach(priv->txirq, up_interrupt, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
irq_detach(priv->rxirq);
|
||||
@@ -772,7 +772,7 @@ static int up_attach(struct uart_dev_s *dev)
|
||||
up_enable_irq(priv->txirq);
|
||||
|
||||
#else
|
||||
ret = irq_attach(priv->irq, up_interrupt);
|
||||
ret = irq_attach(priv->irq, up_interrupt, NULL);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Enable the interrupt (RX and TX interrupts are still disabled
|
||||
@@ -877,7 +877,7 @@ static inline struct uart_dev_s *up_mapirq(int irq)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_interrupt(int irq, void *context)
|
||||
static int up_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
struct uart_dev_s *dev;
|
||||
struct up_dev_s *priv;
|
||||
|
||||
@@ -165,7 +165,7 @@ static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer,
|
||||
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
static inline struct imx_spidev_s *spi_mapirq(int irq);
|
||||
static int spi_interrupt(int irq, void *context);
|
||||
static int spi_interrupt(int irq, void *context, FAR void *arg, FAR void *arg);
|
||||
#endif
|
||||
|
||||
/* SPI methods */
|
||||
@@ -653,7 +653,7 @@ static inline struct imx_spidev_s *spi_mapirq(int irq)
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
static int spi_interrupt(int irq, void *context)
|
||||
static int spi_interrupt(int irq, void *context, FAR void *arg, FAR void *arg)
|
||||
{
|
||||
struct imx_spidev_s *priv = spi_mapirq(irq);
|
||||
int ntxd;
|
||||
@@ -1168,7 +1168,7 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port)
|
||||
/* Attach the interrupt */
|
||||
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
irq_attach(priv->irq, (xcpt_t)spi_interrupt);
|
||||
irq_attach(priv->irq, (xcpt_t)spi_interrupt, NULL);
|
||||
#endif
|
||||
|
||||
/* Enable SPI */
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int imx_timerisr(int irq, uint32_t *regs)
|
||||
static int imx_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
{
|
||||
uint32_t tstat;
|
||||
int ret = -EIO;
|
||||
@@ -150,7 +150,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt */
|
||||
|
||||
irq_attach(IMX_IRQ_SYSTIMER, (xcpt_t)imx_timerisr);
|
||||
irq_attach(IMX_IRQ_SYSTIMER, (xcpt_t)imx_timerisr, NULL);
|
||||
up_enable_irq(IMX_IRQ_SYSTIMER);
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,6 @@ struct imx_spidev_s
|
||||
uint8_t spindx; /* SPI index */
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
uint8_t irq; /* SPI IRQ number */
|
||||
xcpt_t handler; /* ECSPI interrupt handler */
|
||||
#endif
|
||||
|
||||
/* Per SPI callouts to board-specific logic */
|
||||
@@ -223,22 +222,7 @@ static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer,
|
||||
/* Interrupt handling */
|
||||
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
static int spi_interrupt(struct imx_spidev_s *priv);
|
||||
#ifdef CONFIG_IMX6_ECSPI1
|
||||
static int ecspi1_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_ECSPI2
|
||||
static int ecspi2_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_ECSPI3
|
||||
static int ecspi3_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_ECSPI4
|
||||
static int ecspi4_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_ECSPI5
|
||||
static int ecspi5_interrupt(int irq, void *context);
|
||||
#endif
|
||||
static int spi_interrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
|
||||
/* SPI methods */
|
||||
@@ -307,7 +291,6 @@ static struct imx_spidev_s g_spidev[] =
|
||||
.spindx = SPI1_NDX,
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
.irq = IMX_IRQ_ECSPI1,
|
||||
.handler = ecspi1_interrupt,
|
||||
#endif
|
||||
.select = imx_spi1select,
|
||||
.status = imx_spi1status,
|
||||
@@ -324,7 +307,6 @@ static struct imx_spidev_s g_spidev[] =
|
||||
.spindx = SPI2_NDX,
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
.irq = IMX_IRQ_ECSPI2,
|
||||
.handler = ecspi2_interrupt,
|
||||
#endif
|
||||
.select = imx_spi2select,
|
||||
.status = imx_spi2status,
|
||||
@@ -341,7 +323,6 @@ static struct imx_spidev_s g_spidev[] =
|
||||
.spindx = SPI3_NDX,
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
.irq = IMX_IRQ_ECSPI3,
|
||||
.handler = ecspi3_interrupt,
|
||||
#endif
|
||||
.select = imx_spi3select,
|
||||
.status = imx_spi3status,
|
||||
@@ -358,7 +339,6 @@ static struct imx_spidev_s g_spidev[] =
|
||||
.spindx = SPI4_NDX,
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
.irq = IMX_IRQ_ECSPI4,
|
||||
.handler = ecspi4_interrupt,
|
||||
#endif
|
||||
.select = imx_spi4select,
|
||||
.status = imx_spi4status,
|
||||
@@ -375,7 +355,6 @@ static struct imx_spidev_s g_spidev[] =
|
||||
.spindx = SPI5_NDX,
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
.irq = IMX_IRQ_ECSPI5,
|
||||
.handler = ecspi5_interrupt,
|
||||
#endif
|
||||
.select = imx_spi5select,
|
||||
.status = imx_spi5status,
|
||||
@@ -759,8 +738,9 @@ static int spi_transfer(struct imx_spidev_s *priv, const void *txbuffer,
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
static int spi_interrupt(struct imx_spidev_s *priv)
|
||||
static int spi_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
struct imx_spidev_s *priv = (struct imx_spidev_s *)arg;
|
||||
int ntxd;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
@@ -790,57 +770,6 @@ static int spi_interrupt(struct imx_spidev_s *priv)
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ecspiN_interrupt, N=1..5
|
||||
*
|
||||
* Description:
|
||||
* Individual ECPSI interrupt handlers.
|
||||
*
|
||||
* Input Parameters:
|
||||
* Standard interrupt handler inputs
|
||||
*
|
||||
* Returned Value:
|
||||
* 0: success, <0:Negated error number on failure
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
#ifdef CONFIG_IMX6_ECSPI1
|
||||
static int ecspi1_interrupt(int irq, void *context)
|
||||
{
|
||||
return spi_interrupt(&g_spidev[SPI1_NDX]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IMX6_ECSPI2
|
||||
static int ecspi2_interrupt(int irq, void *context)
|
||||
{
|
||||
return spi_interrupt(&g_spidev[SPI2_NDX]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IMX6_ECSPI3
|
||||
static int ecspi3_interrupt(int irq, void *context)
|
||||
{
|
||||
return spi_interrupt(&g_spidev[SPI3_NDX]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IMX6_ECSPI4
|
||||
static int ecspi4_interrupt(int irq, void *context)
|
||||
{
|
||||
return spi_interrupt(&g_spidev[SPI4_NDX]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IMX6_ECSPI5
|
||||
static int ecspi5_interrupt(int irq, void *context)
|
||||
{
|
||||
return spi_interrupt(&g_spidev[SPI5_NDX]);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_lock
|
||||
*
|
||||
@@ -1425,7 +1354,7 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port)
|
||||
/* Attach the interrupt */
|
||||
|
||||
#ifndef CONFIG_SPI_POLLWAIT
|
||||
DEBUGVERIFY(irq_attach(priv->irq, priv->handler));
|
||||
DEBUGVERIFY(irq_attach(priv->irq, spi_interrupt, priv));
|
||||
#endif
|
||||
|
||||
/* Enable SPI */
|
||||
|
||||
@@ -199,7 +199,6 @@
|
||||
|
||||
struct imx_uart_s
|
||||
{
|
||||
xcpt_t handler; /* Interrupt handler */
|
||||
uint32_t uartbase; /* Base address of UART registers */
|
||||
uint32_t baud; /* Configured baud */
|
||||
uint32_t ucr1; /* Saved UCR1 value */
|
||||
@@ -229,24 +228,7 @@ static int imx_setup(struct uart_dev_s *dev);
|
||||
static void imx_shutdown(struct uart_dev_s *dev);
|
||||
static int imx_attach(struct uart_dev_s *dev);
|
||||
static void imx_detach(struct uart_dev_s *dev);
|
||||
|
||||
static int imx_interrupt(struct uart_dev_s *dev);
|
||||
#ifdef CONFIG_IMX6_UART1
|
||||
static int imx_uart1_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_UART2
|
||||
static int imx_uart2_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_UART3
|
||||
static int imx_uart3_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_UART4
|
||||
static int imx_uart4_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_UART5
|
||||
static int imx_uart5_interrupt(int irq, void *context);
|
||||
#endif
|
||||
|
||||
static int imx_interrupt(int irq, void *context, FAR void *arg);
|
||||
static int imx_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int imx_receive(struct uart_dev_s *dev, uint32_t *status);
|
||||
static void imx_rxint(struct uart_dev_s *dev, bool enable);
|
||||
@@ -317,7 +299,6 @@ static char g_uart5txbuffer[CONFIG_UART5_TXBUFSIZE];
|
||||
#ifdef CONFIG_IMX6_UART1
|
||||
static struct imx_uart_s g_uart1priv =
|
||||
{
|
||||
.handler = imx_uart1_interrupt,
|
||||
.uartbase = IMX_UART1_VBASE,
|
||||
.baud = CONFIG_UART1_BAUD,
|
||||
.irq = IMX_IRQ_UART1,
|
||||
@@ -348,7 +329,6 @@ static struct uart_dev_s g_uart1port =
|
||||
#ifdef CONFIG_IMX6_UART2
|
||||
static struct imx_uart_s g_uart2priv =
|
||||
{
|
||||
.handler = imx_uart2_interrupt,
|
||||
.uartbase = IMX_UART2_VBASE,
|
||||
.baud = CONFIG_UART2_BAUD,
|
||||
.irq = IMX_IRQ_UART2,
|
||||
@@ -377,7 +357,6 @@ static struct uart_dev_s g_uart2port =
|
||||
#ifdef CONFIG_IMX6_UART3
|
||||
static struct imx_uart_s g_uart3priv =
|
||||
{
|
||||
.handler = imx_uart3_interrupt,
|
||||
.uartbase = IMX_UART3_REGISTER_BASE,
|
||||
.baud = IMX_UART3_VBASE,
|
||||
.irq = IMX_IRQ_UART3,
|
||||
@@ -406,7 +385,6 @@ static struct uart_dev_s g_uart3port =
|
||||
#ifdef CONFIG_IMX6_UART4
|
||||
static struct imx_uart_s g_uart4priv =
|
||||
{
|
||||
.handler = imx_uart4_interrupt,
|
||||
.uartbase = IMX_UART4_REGISTER_BASE,
|
||||
.baud = IMX_UART4_VBASE,
|
||||
.irq = IMX_IRQ_UART4,
|
||||
@@ -435,7 +413,6 @@ static struct uart_dev_s g_uart4port =
|
||||
#ifdef CONFIG_IMX6_UART5
|
||||
static struct imx_uart_s g_uart5priv =
|
||||
{
|
||||
.handler = imx_uart5_interrupt,
|
||||
.uartbase = IMX_UART5_REGISTER_BASE,
|
||||
.baud = IMX_UART5_VBASE,
|
||||
.irq = IMX_IRQ_UART5,
|
||||
@@ -618,7 +595,7 @@ static int imx_attach(struct uart_dev_s *dev)
|
||||
|
||||
/* Attach and enable the IRQ */
|
||||
|
||||
ret = irq_attach(priv->irq, priv->handler);
|
||||
ret = irq_attach(priv->irq, imx_interrupt, priv);
|
||||
if (ret == OK)
|
||||
{
|
||||
/* Configure as a (high) level interrupt */
|
||||
@@ -663,12 +640,16 @@ static void imx_detach(struct uart_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int imx_interrupt(struct uart_dev_s *dev)
|
||||
static int imx_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
struct imx_uart_s *priv = (struct imx_uart_s *)dev->priv;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct imx_uart_s *priv;
|
||||
uint32_t usr1;
|
||||
int passes = 0;
|
||||
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
priv = (struct imx_uart_s *)dev->priv;
|
||||
|
||||
/* Loop until there are no characters to be transferred or,
|
||||
* until we have been looping for a long time.
|
||||
*/
|
||||
@@ -710,46 +691,6 @@ static int imx_interrupt(struct uart_dev_s *dev)
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: imx_uart[n]_interrupt
|
||||
*
|
||||
* Description:
|
||||
* UART-specific interrupt handlers just transfer control to the common
|
||||
* UART interrupt handler, passing the relevant driver state structure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_IMX6_UART1
|
||||
static int imx_uart1_interrupt(int irq, void *context)
|
||||
{
|
||||
return imx_interrupt(&g_uart1port);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_UART2
|
||||
static int imx_uart2_interrupt(int irq, void *context)
|
||||
{
|
||||
return imx_interrupt(&g_uart2port);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_UART3
|
||||
static int imx_uart3_interrupt(int irq, void *context)
|
||||
{
|
||||
return imx_interrupt(&g_uart3port);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_UART4
|
||||
static int imx_uart4_interrupt(int irq, void *context)
|
||||
{
|
||||
return imx_interrupt(&g_uart4port);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_IMX6_UART5
|
||||
static int imx_uart5_interrupt(int irq, void *context)
|
||||
{
|
||||
return imx_interrupt(&g_uart5port);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: imx_ioctl
|
||||
*
|
||||
|
||||
@@ -130,7 +130,7 @@ static void imx_output_compare(uint32_t sr, uint32_t of)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int imx_timerisr(int irq, uint32_t *regs)
|
||||
static int imx_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
{
|
||||
/* Sample the SR (once) */
|
||||
|
||||
@@ -260,7 +260,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(IMX_IRQ_GPT, (xcpt_t)imx_timerisr);
|
||||
(void)irq_attach(IMX_IRQ_GPT, (xcpt_t)imx_timerisr, NULL);
|
||||
|
||||
/* Enable all three GPT output compare interrupts */
|
||||
|
||||
|
||||
@@ -567,9 +567,11 @@ void kinetis_pinirqinitialize(void);
|
||||
* 2. Call kinetis_pinirqattach() to attach the pin interrupt handling function.
|
||||
* 3. Call kinetis_pinirqenable() to enable interrupts on the pin.
|
||||
*
|
||||
* Input Parameters:
|
||||
* pinset - Pin configuration
|
||||
* pinisr - Pin interrupt service routine
|
||||
* Parameters:
|
||||
* pinset - Pin configuration
|
||||
* pinisr -:wq
|
||||
:wq: Pin interrupt service routine
|
||||
* arg:r - And argument that will be provided to the interrupt service routine.
|
||||
*
|
||||
* Return Value:
|
||||
* The previous value of the interrupt handler function pointer. This value may,
|
||||
@@ -578,7 +580,7 @@ void kinetis_pinirqinitialize(void);
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
xcpt_t kinetis_pinirqattach(uint32_t pinset, xcpt_t pinisr);
|
||||
xcpt_t kinetis_pinirqattach(uint32_t pinset, xcpt_t pinisr, void *arg);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: kinetis_pinirqenable
|
||||
|
||||
@@ -284,7 +284,7 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv);
|
||||
static void kinetis_txdone(FAR struct kinetis_driver_s *priv);
|
||||
|
||||
static void kinetis_interrupt_work(FAR void *arg);
|
||||
static int kinetis_interrupt(int irq, FAR void *context);
|
||||
static int kinetis_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
|
||||
/* Watchdog timer expirations */
|
||||
|
||||
@@ -921,7 +921,7 @@ static void kinetis_interrupt_work(FAR void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int kinetis_interrupt(int irq, FAR void *context)
|
||||
static int kinetis_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
register FAR struct kinetis_driver_s *priv = &g_enet[0];
|
||||
|
||||
@@ -2097,7 +2097,7 @@ int kinetis_netinitialize(int intf)
|
||||
/* Attach the Ethernet MAC IEEE 1588 timer interrupt handler */
|
||||
|
||||
#if 0
|
||||
if (irq_attach(KINETIS_IRQ_EMACTMR, kinetis_tmrinterrupt))
|
||||
if (irq_attach(KINETIS_IRQ_EMACTMR, kinetis_tmrinterrupt, NULL))
|
||||
{
|
||||
/* We could not attach the ISR to the interrupt */
|
||||
|
||||
@@ -2108,7 +2108,7 @@ int kinetis_netinitialize(int intf)
|
||||
|
||||
/* Attach the Ethernet MAC transmit interrupt handler */
|
||||
|
||||
if (irq_attach(KINETIS_IRQ_EMACTX, kinetis_interrupt))
|
||||
if (irq_attach(KINETIS_IRQ_EMACTX, kinetis_interrupt, NULL))
|
||||
{
|
||||
/* We could not attach the ISR to the interrupt */
|
||||
|
||||
@@ -2118,7 +2118,7 @@ int kinetis_netinitialize(int intf)
|
||||
|
||||
/* Attach the Ethernet MAC receive interrupt handler */
|
||||
|
||||
if (irq_attach(KINETIS_IRQ_EMACRX, kinetis_interrupt))
|
||||
if (irq_attach(KINETIS_IRQ_EMACRX, kinetis_interrupt, NULL))
|
||||
{
|
||||
/* We could not attach the ISR to the interrupt */
|
||||
|
||||
@@ -2128,7 +2128,7 @@ int kinetis_netinitialize(int intf)
|
||||
|
||||
/* Attach the Ethernet MAC error and misc interrupt handler */
|
||||
|
||||
if (irq_attach(KINETIS_IRQ_EMACMISC, kinetis_interrupt))
|
||||
if (irq_attach(KINETIS_IRQ_EMACMISC, kinetis_interrupt, NULL))
|
||||
{
|
||||
/* We could not attach the ISR to the interrupt */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/kinetis/kinetis_i2c.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Matias v01d <phreakuencies@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -129,16 +129,7 @@ static void kinetis_i2c_setfrequency(struct kinetis_i2cdev_s *priv,
|
||||
uint32_t frequency);
|
||||
static int kinetis_i2c_start(struct kinetis_i2cdev_s *priv);
|
||||
static void kinetis_i2c_stop(struct kinetis_i2cdev_s *priv);
|
||||
static int kinetis_i2c_interrupt(struct kinetis_i2cdev_s *priv);
|
||||
#ifdef CONFIG_KINETIS_I2C0
|
||||
static int kinetis_i2c0_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_I2C1
|
||||
static int kinetis_i2c1_interrupt(int irq, void *context);
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_I2C2
|
||||
static int kinetis_i2c2_interrupt(int irq, void *context);
|
||||
#endif
|
||||
static int kinetis_i2c_interrupt(int irq, void *context, void *arg);
|
||||
static void kinetis_i2c_timeout(int argc, uint32_t arg, ...);
|
||||
static void kinetis_i2c_setfrequency(struct kinetis_i2cdev_s *priv,
|
||||
uint32_t frequency);
|
||||
@@ -638,14 +629,17 @@ void kinetis_i2c_nextmsg(struct kinetis_i2cdev_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int kinetis_i2c_interrupt(struct kinetis_i2cdev_s *priv)
|
||||
static int kinetis_i2c_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct kinetis_i2cdev_s *priv = (struct kinetis_i2cdev_s *)arg;
|
||||
struct i2c_msg_s *msg;
|
||||
uint32_t state;
|
||||
int regval;
|
||||
int dummy;
|
||||
UNUSED(dummy);
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
||||
/* Get current state */
|
||||
|
||||
state = kinetis_i2c_getreg(priv, KINETIS_I2C_S_OFFSET);
|
||||
@@ -811,38 +805,6 @@ static int kinetis_i2c_interrupt(struct kinetis_i2cdev_s *priv)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: kinetis_i2cN_interrupt
|
||||
*
|
||||
* Description:
|
||||
* The I2CN interrupt handlers
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_KINETIS_I2C0
|
||||
static int kinetis_i2c0_interrupt(int irq, void *context)
|
||||
{
|
||||
i2cinfo("I2C0 Interrupt...\n");
|
||||
return kinetis_i2c_interrupt(&g_i2c0_dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KINETIS_I2C1
|
||||
static int kinetis_i2c1_interrupt(int irq, void *context)
|
||||
{
|
||||
i2cinfo("I2C1 Interrupt...\n");
|
||||
return kinetis_i2c_interrupt(&g_i2c1_dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KINETIS_I2C2
|
||||
static int kinetis_i2c2_interrupt(int irq, void *context)
|
||||
{
|
||||
i2cinfo("I2C2 Interrupt...\n");
|
||||
return kinetis_i2c_interrupt(&g_i2c2_dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: kinetis_i2c_transfer
|
||||
*
|
||||
@@ -988,7 +950,6 @@ static int kinetis_i2c_reset(struct i2c_master_s *dev)
|
||||
struct i2c_master_s *kinetis_i2cbus_initialize(int port)
|
||||
{
|
||||
struct kinetis_i2cdev_s *priv;
|
||||
xcpt_t handler;
|
||||
|
||||
i2cinfo("port=%d\n", port);
|
||||
|
||||
@@ -1011,8 +972,6 @@ struct i2c_master_s *kinetis_i2cbus_initialize(int port)
|
||||
priv->irqid = KINETIS_IRQ_I2C0;
|
||||
priv->basefreq = BOARD_BUS_FREQ;
|
||||
|
||||
handler = kinetis_i2c0_interrupt;
|
||||
|
||||
/* Enable clock */
|
||||
|
||||
regval = getreg32(KINETIS_SIM_SCGC4);
|
||||
@@ -1038,8 +997,6 @@ struct i2c_master_s *kinetis_i2cbus_initialize(int port)
|
||||
priv->irqid = KINETIS_IRQ_I2C1;
|
||||
priv->basefreq = BOARD_BUS_FREQ;
|
||||
|
||||
handler = kinetis_i2c1_interrupt;
|
||||
|
||||
/* Enable clock */
|
||||
|
||||
regval = getreg32(KINETIS_SIM_SCGC4);
|
||||
@@ -1065,8 +1022,6 @@ struct i2c_master_s *kinetis_i2cbus_initialize(int port)
|
||||
priv->irqid = KINETIS_IRQ_I2C2;
|
||||
priv->basefreq = BOARD_BUS_FREQ;
|
||||
|
||||
handler = kinetis_i2c2_interrupt;
|
||||
|
||||
/* Enable clock */
|
||||
|
||||
regval = getreg32(KINETIS_SIM_SCGC4);
|
||||
@@ -1124,7 +1079,7 @@ struct i2c_master_s *kinetis_i2cbus_initialize(int port)
|
||||
|
||||
/* Attach Interrupt Handler */
|
||||
|
||||
irq_attach(priv->irqid, handler);
|
||||
irq_attach(priv->irqid, kinetis_i2c_interrupt, priv);
|
||||
|
||||
/* Enable Interrupt Handler */
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ static void kinetis_dumpnvic(const char *msg, int irq)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int kinetis_nmi(int irq, FAR void *context)
|
||||
static int kinetis_nmi(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! NMI received\n");
|
||||
@@ -178,7 +178,7 @@ static int kinetis_nmi(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kinetis_busfault(int irq, FAR void *context)
|
||||
static int kinetis_busfault(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Bus fault recived\n");
|
||||
@@ -186,7 +186,7 @@ static int kinetis_busfault(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kinetis_usagefault(int irq, FAR void *context)
|
||||
static int kinetis_usagefault(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Usage fault received\n");
|
||||
@@ -194,7 +194,7 @@ static int kinetis_usagefault(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kinetis_pendsv(int irq, FAR void *context)
|
||||
static int kinetis_pendsv(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! PendSV received\n");
|
||||
@@ -202,7 +202,7 @@ static int kinetis_pendsv(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kinetis_dbgmonitor(int irq, FAR void *context)
|
||||
static int kinetis_dbgmonitor(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Debug Monitor received\n");
|
||||
@@ -210,7 +210,7 @@ static int kinetis_dbgmonitor(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kinetis_reserved(int irq, FAR void *context)
|
||||
static int kinetis_reserved(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Reserved interrupt\n");
|
||||
@@ -398,8 +398,8 @@ void up_irqinitialize(void)
|
||||
* under certain conditions.
|
||||
*/
|
||||
|
||||
irq_attach(KINETIS_IRQ_SVCALL, up_svcall);
|
||||
irq_attach(KINETIS_IRQ_HARDFAULT, up_hardfault);
|
||||
irq_attach(KINETIS_IRQ_SVCALL, up_svcall, NULL);
|
||||
irq_attach(KINETIS_IRQ_HARDFAULT, up_hardfault, NULL);
|
||||
|
||||
/* Set the priority of the SVCall interrupt */
|
||||
|
||||
@@ -415,22 +415,22 @@ void up_irqinitialize(void)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARM_MPU
|
||||
irq_attach(KINETIS_IRQ_MEMFAULT, up_memfault);
|
||||
irq_attach(KINETIS_IRQ_MEMFAULT, up_memfault, NULL);
|
||||
up_enable_irq(KINETIS_IRQ_MEMFAULT);
|
||||
#endif
|
||||
|
||||
/* Attach all other processor exceptions (except reset and sys tick) */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
irq_attach(KINETIS_IRQ_NMI, kinetis_nmi);
|
||||
irq_attach(KINETIS_IRQ_NMI, kinetis_nmi, NULL);
|
||||
#ifndef CONFIG_ARM_MPU
|
||||
irq_attach(KINETIS_IRQ_MEMFAULT, up_memfault);
|
||||
irq_attach(KINETIS_IRQ_MEMFAULT, up_memfault, NULL);
|
||||
#endif
|
||||
irq_attach(KINETIS_IRQ_BUSFAULT, kinetis_busfault);
|
||||
irq_attach(KINETIS_IRQ_USAGEFAULT, kinetis_usagefault);
|
||||
irq_attach(KINETIS_IRQ_PENDSV, kinetis_pendsv);
|
||||
irq_attach(KINETIS_IRQ_DBGMONITOR, kinetis_dbgmonitor);
|
||||
irq_attach(KINETIS_IRQ_RESERVED, kinetis_reserved);
|
||||
irq_attach(KINETIS_IRQ_BUSFAULT, kinetis_busfault, NULL);
|
||||
irq_attach(KINETIS_IRQ_USAGEFAULT, kinetis_usagefault, NULL);
|
||||
irq_attach(KINETIS_IRQ_PENDSV, kinetis_pendsv, NULL);
|
||||
irq_attach(KINETIS_IRQ_DBGMONITOR, kinetis_dbgmonitor, NULL);
|
||||
irq_attach(KINETIS_IRQ_RESERVED, kinetis_reserved, NULL);
|
||||
#endif
|
||||
|
||||
kinetis_dumpnvic("initial", NR_IRQS);
|
||||
|
||||
@@ -163,7 +163,7 @@ static int kinetis_setup(struct uart_dev_s *dev);
|
||||
static void kinetis_shutdown(struct uart_dev_s *dev);
|
||||
static int kinetis_attach(struct uart_dev_s *dev);
|
||||
static void kinetis_detach(struct uart_dev_s *dev);
|
||||
static int kinetis_interrupt(int irq, void *context);
|
||||
static int kinetis_interrupt(int irq, void *context, void *arg);
|
||||
static int kinetis_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int kinetis_receive(struct uart_dev_s *dev, uint32_t *status);
|
||||
static void kinetis_rxint(struct uart_dev_s *dev, bool enable);
|
||||
@@ -427,7 +427,7 @@ static int kinetis_attach(struct uart_dev_s *dev)
|
||||
* disabled in the LPUART_CTRL register.
|
||||
*/
|
||||
|
||||
ret = irq_attach(priv->irq, kinetis_interrupt);
|
||||
ret = irq_attach(priv->irq, kinetis_interrupt, dev);
|
||||
if (ret == OK)
|
||||
{
|
||||
up_enable_irq(priv->irq);
|
||||
@@ -472,33 +472,15 @@ static void kinetis_detach(struct uart_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int kinetis_interrupt(int irq, void *context)
|
||||
static int kinetis_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct uart_dev_s *dev = NULL;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *dev)arg;
|
||||
struct kinetis_dev_s *priv;
|
||||
uint32_t stat;
|
||||
uint32_t ctrl;
|
||||
|
||||
#ifdef CONFIG_KINETIS_LPUART0
|
||||
if (g_lpuart0priv.irq == irq)
|
||||
{
|
||||
dev = &g_lpuart0port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_LPUART1
|
||||
if (g_lpuart1priv.irq == irq)
|
||||
{
|
||||
dev = &g_lpuart1port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
PANIC();
|
||||
}
|
||||
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
priv = (struct kinetis_dev_s *)dev->priv;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Read status register and qualify it with STAT bit corresponding CTRL IE bits */
|
||||
|
||||
|
||||
@@ -73,6 +73,12 @@
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
struct kinetis_pinirq_s
|
||||
{
|
||||
xcpt_t handler;
|
||||
void *arg;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@@ -84,19 +90,19 @@
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_KINETIS_PORTAINTS
|
||||
static xcpt_t g_portaisrs[32];
|
||||
static struct kinetis_pinirq_s g_portaisrs[32];
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTBINTS
|
||||
static xcpt_t g_portbisrs[32];
|
||||
static struct kinetis_pinirq_s g_portbisrs[32];
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTCINTS
|
||||
static xcpt_t g_portcisrs[32];
|
||||
static struct kinetis_pinirq_s g_portcisrs[32];
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTDINTS
|
||||
static xcpt_t g_portdisrs[32];
|
||||
static struct kinetis_pinirq_s g_portdisrs[32];
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTEINTS
|
||||
static xcpt_t g_porteisrs[32];
|
||||
static struct kinetis_pinirq_s g_porteisrs[32];
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -113,7 +119,7 @@ static xcpt_t g_porteisrs[32];
|
||||
|
||||
#ifdef HAVE_PORTINTS
|
||||
static int kinetis_portinterrupt(int irq, FAR void *context,
|
||||
uintptr_t addr, xcpt_t *isrtab)
|
||||
uintptr_t addr, struct kinetis_pinirq_s *isrtab)
|
||||
{
|
||||
uint32_t isfr = getreg32(addr);
|
||||
int i;
|
||||
@@ -136,11 +142,14 @@ static int kinetis_portinterrupt(int irq, FAR void *context,
|
||||
* interrupt handler for the pin.
|
||||
*/
|
||||
|
||||
if (isrtab[i])
|
||||
if (isrtab[i].handler != NULL)
|
||||
{
|
||||
xcpt_t handler = isrtab[i].handler;
|
||||
void *arg = isrtab[i].arg;
|
||||
|
||||
/* There is a registered interrupt handler... invoke it */
|
||||
|
||||
(void)isrtab[i](irq, context);
|
||||
(void)handler(irq, context, arg);
|
||||
}
|
||||
|
||||
/* Writing a one to the ISFR register will clear the pending
|
||||
@@ -169,31 +178,31 @@ static int kinetis_portinterrupt(int irq, FAR void *context,
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_KINETIS_PORTAINTS
|
||||
static int kinetis_portainterrupt(int irq, FAR void *context)
|
||||
static int kinetis_portainterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
return kinetis_portinterrupt(irq, context, KINETIS_PORTA_ISFR, g_portaisrs);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTBINTS
|
||||
static int kinetis_portbinterrupt(int irq, FAR void *context)
|
||||
static int kinetis_portbinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
return kinetis_portinterrupt(irq, context, KINETIS_PORTB_ISFR, g_portbisrs);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTCINTS
|
||||
static int kinetis_portcinterrupt(int irq, FAR void *context)
|
||||
static int kinetis_portcinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
return kinetis_portinterrupt(irq, context, KINETIS_PORTC_ISFR, g_portcisrs);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTDINTS
|
||||
static int kinetis_portdinterrupt(int irq, FAR void *context)
|
||||
static int kinetis_portdinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
return kinetis_portinterrupt(irq, context, KINETIS_PORTD_ISFR, g_portdisrs);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTEINTS
|
||||
static int kinetis_porteinterrupt(int irq, FAR void *context)
|
||||
static int kinetis_porteinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
return kinetis_portinterrupt(irq, context, KINETIS_PORTE_ISFR, g_porteisrs);
|
||||
}
|
||||
@@ -215,27 +224,27 @@ static int kinetis_porteinterrupt(int irq, FAR void *context)
|
||||
void kinetis_pinirqinitialize(void)
|
||||
{
|
||||
#ifdef CONFIG_KINETIS_PORTAINTS
|
||||
(void)irq_attach(KINETIS_IRQ_PORTA, kinetis_portainterrupt);
|
||||
(void)irq_attach(KINETIS_IRQ_PORTA, kinetis_portainterrupt, NULL);
|
||||
putreg32(0xffffffff, KINETIS_PORTA_ISFR);
|
||||
up_enable_irq(KINETIS_IRQ_PORTA);
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTBINTS
|
||||
(void)irq_attach(KINETIS_IRQ_PORTB, kinetis_portbinterrupt);
|
||||
(void)irq_attach(KINETIS_IRQ_PORTB, kinetis_portbinterrupt, NULL);
|
||||
putreg32(0xffffffff, KINETIS_PORTB_ISFR);
|
||||
up_enable_irq(KINETIS_IRQ_PORTB);
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTCINTS
|
||||
(void)irq_attach(KINETIS_IRQ_PORTC, kinetis_portcinterrupt);
|
||||
(void)irq_attach(KINETIS_IRQ_PORTC, kinetis_portcinterrupt, NULL);
|
||||
putreg32(0xffffffff, KINETIS_PORTC_ISFR);
|
||||
up_enable_irq(KINETIS_IRQ_PORTC);
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTDINTS
|
||||
(void)irq_attach(KINETIS_IRQ_PORTD, kinetis_portdinterrupt);
|
||||
(void)irq_attach(KINETIS_IRQ_PORTD, kinetis_portdinterrupt, NULL);
|
||||
putreg32(0xffffffff, KINETIS_PORTD_ISFR);
|
||||
up_enable_irq(KINETIS_IRQ_PORTD);
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_PORTEINTS
|
||||
(void)irq_attach(KINETIS_IRQ_PORTE, kinetis_porteinterrupt);
|
||||
(void)irq_attach(KINETIS_IRQ_PORTE, kinetis_porteinterrupt, NULL);
|
||||
putreg32(0xffffffff, KINETIS_PORTE_ISFR);
|
||||
up_enable_irq(KINETIS_IRQ_PORTE);
|
||||
#endif
|
||||
@@ -263,12 +272,12 @@ void kinetis_pinirqinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
xcpt_t kinetis_pinirqattach(uint32_t pinset, xcpt_t pinisr)
|
||||
xcpt_t kinetis_pinirqattach(uint32_t pinset, xcpt_t pinisr, void *arg)
|
||||
{
|
||||
#ifdef HAVE_PORTINTS
|
||||
xcpt_t *isrtab;
|
||||
xcpt_t oldisr;
|
||||
irqstate_t flags;
|
||||
struct kinetis_pinirq_s *isrtab;
|
||||
xcpt_t oldisr;
|
||||
irqstate_t flags;
|
||||
unsigned int port;
|
||||
unsigned int pin;
|
||||
|
||||
@@ -322,8 +331,9 @@ xcpt_t kinetis_pinirqattach(uint32_t pinset, xcpt_t pinisr)
|
||||
|
||||
/* Get the old PIN ISR and set the new PIN ISR */
|
||||
|
||||
oldisr = isrtab[pin];
|
||||
isrtab[pin] = pinisr;
|
||||
oldisr = isrtab[pin].handler;
|
||||
isrtab[pin].handler = pinisr;
|
||||
isrtab[pin].arg = arg;
|
||||
|
||||
/* And return the old PIN isr address */
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ static void rtc_dumptime(FAR struct tm *tp, FAR const char *msg)
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_RTC_ALARM)
|
||||
static int kinetis_rtc_interrupt(int irq, void *context)
|
||||
static int kinetis_rtc_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
uint16_t rtc_sr;
|
||||
|
||||
@@ -279,7 +279,7 @@ int up_rtc_irq_attach(void)
|
||||
* KINETIS_IRQ_RTCS is a separate interrupt for seconds if needed
|
||||
*/
|
||||
|
||||
irq_attach(KINETIS_IRQ_RTC, kinetis_rtc_interrupt);
|
||||
irq_attach(KINETIS_IRQ_RTC, kinetis_rtc_interrupt, NULL);
|
||||
up_enable_irq(KINETIS_IRQ_RTC);
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ static void kinetis_endtransfer(struct kinetis_dev_s *priv, sdio_eventset_t wkup
|
||||
|
||||
/* Interrupt Handling *******************************************************/
|
||||
|
||||
static int kinetis_interrupt(int irq, void *context);
|
||||
static int kinetis_interrupt(int irq, void *context, FAR void *arg);
|
||||
|
||||
/* SDIO interface methods ***************************************************/
|
||||
|
||||
@@ -1065,7 +1065,7 @@ static void kinetis_endtransfer(struct kinetis_dev_s *priv, sdio_eventset_t wkup
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int kinetis_interrupt(int irq, void *context)
|
||||
static int kinetis_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
struct kinetis_dev_s *priv = &g_sdhcdev;
|
||||
uint32_t enabled;
|
||||
@@ -1681,7 +1681,7 @@ static int kinetis_attach(FAR struct sdio_dev_s *dev)
|
||||
|
||||
/* Attach the SDIO interrupt handler */
|
||||
|
||||
ret = irq_attach(KINETIS_IRQ_SDHC, kinetis_interrupt);
|
||||
ret = irq_attach(KINETIS_IRQ_SDHC, kinetis_interrupt, NULL);
|
||||
if (ret == OK)
|
||||
{
|
||||
|
||||
|
||||
@@ -253,9 +253,9 @@ static void up_shutdown(struct uart_dev_s *dev);
|
||||
static int up_attach(struct uart_dev_s *dev);
|
||||
static void up_detach(struct uart_dev_s *dev);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int up_interrupt(int irq, void *context);
|
||||
static int up_interrupt(int irq, void *context, FAR void *arg);
|
||||
#endif
|
||||
static int up_interrupts(int irq, void *context);
|
||||
static int up_interrupts(int irq, void *context, FAR void *arg);
|
||||
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
|
||||
static int up_receive(struct uart_dev_s *dev, uint32_t *status);
|
||||
static void up_rxint(struct uart_dev_s *dev, bool enable);
|
||||
@@ -688,11 +688,11 @@ static int up_attach(struct uart_dev_s *dev)
|
||||
* disabled in the C2 register.
|
||||
*/
|
||||
|
||||
ret = irq_attach(priv->irqs, up_interrupts);
|
||||
ret = irq_attach(priv->irqs, up_interrupts, dev);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (ret == OK)
|
||||
{
|
||||
ret = irq_attach(priv->irqe, up_interrupt);
|
||||
ret = irq_attach(priv->irqe, up_interrupt, dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -747,60 +747,14 @@ static void up_detach(struct uart_dev_s *dev)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int up_interrupt(int irq, void *context)
|
||||
static int up_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
struct uart_dev_s *dev = NULL;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct up_dev_s *priv;
|
||||
uint8_t regval;
|
||||
|
||||
#ifdef CONFIG_KINETIS_UART0
|
||||
if (g_uart0priv.irqe == irq)
|
||||
{
|
||||
dev = &g_uart0port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART1
|
||||
if (g_uart1priv.irqe == irq)
|
||||
{
|
||||
dev = &g_uart1port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART2
|
||||
if (g_uart2priv.irqe == irq)
|
||||
{
|
||||
dev = &g_uart2port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART3
|
||||
if (g_uart3priv.irqe == irq)
|
||||
{
|
||||
dev = &g_uart3port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART4
|
||||
if (g_uart4priv.irqe == irq)
|
||||
{
|
||||
dev = &g_uart4port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART5
|
||||
if (g_uart5priv.irqe == irq)
|
||||
{
|
||||
dev = &g_uart5port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
PANIC();
|
||||
}
|
||||
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
priv = (struct up_dev_s *)dev->priv;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Handle error interrupts. This interrupt may be caused by:
|
||||
*
|
||||
@@ -835,9 +789,9 @@ static int up_interrupt(int irq, void *context)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_interrupts(int irq, void *context)
|
||||
static int up_interrupts(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
struct uart_dev_s *dev = NULL;
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)arg;
|
||||
struct up_dev_s *priv;
|
||||
int passes;
|
||||
#ifdef CONFIG_KINETIS_UARTFIFOS
|
||||
@@ -847,53 +801,8 @@ static int up_interrupts(int irq, void *context)
|
||||
#endif
|
||||
bool handled;
|
||||
|
||||
#ifdef CONFIG_KINETIS_UART0
|
||||
if (g_uart0priv.irqs == irq)
|
||||
{
|
||||
dev = &g_uart0port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART1
|
||||
if (g_uart1priv.irqs == irq)
|
||||
{
|
||||
dev = &g_uart1port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART2
|
||||
if (g_uart2priv.irqs == irq)
|
||||
{
|
||||
dev = &g_uart2port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART3
|
||||
if (g_uart3priv.irqs == irq)
|
||||
{
|
||||
dev = &g_uart3port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART4
|
||||
if (g_uart4priv.irqs == irq)
|
||||
{
|
||||
dev = &g_uart4port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_UART5
|
||||
if (g_uart5priv.irqs == irq)
|
||||
{
|
||||
dev = &g_uart5port;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
PANIC();
|
||||
}
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
priv = (struct up_dev_s *)dev->priv;
|
||||
DEBUGASSERT(priv);
|
||||
|
||||
/* Loop until there are no characters to be transferred or,
|
||||
* until we have been looping for a long time.
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int kinetis_timerisr(int irq, uint32_t *regs)
|
||||
static int kinetis_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@@ -139,7 +139,7 @@ void arm_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(KINETIS_IRQ_SYSTICK, (xcpt_t)kinetis_timerisr);
|
||||
(void)irq_attach(KINETIS_IRQ_SYSTICK, (xcpt_t)kinetis_timerisr, NULL);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
||||
@@ -562,7 +562,7 @@ static void khci_ep0outcomplete(struct khci_usbdev_s *priv);
|
||||
static void khci_ep0incomplete(struct khci_usbdev_s *priv);
|
||||
static void khci_ep0transfer(struct khci_usbdev_s *priv,
|
||||
uint16_t ustat);
|
||||
static int khci_interrupt(int irq, void *context);
|
||||
static int khci_interrupt(int irq, void *context, FAR void *arg);
|
||||
|
||||
/* Endpoint helpers *********************************************************/
|
||||
|
||||
@@ -2713,7 +2713,7 @@ static void khci_ep0transfer(struct khci_usbdev_s *priv, uint16_t ustat)
|
||||
* Name: khci_interrupt
|
||||
****************************************************************************/
|
||||
|
||||
static int khci_interrupt(int irq, void *context)
|
||||
static int khci_interrupt(int irq, void *context, FAR void *arg)
|
||||
{
|
||||
/* For now there is only one USB controller, but we will always refer to
|
||||
* it using a pointer to make any future ports to multiple USB controllers
|
||||
@@ -4431,7 +4431,7 @@ void up_usbinitialize(void)
|
||||
* them when we need them later.
|
||||
*/
|
||||
|
||||
if (irq_attach(KINETIS_IRQ_USBOTG, khci_interrupt) != 0)
|
||||
if (irq_attach(KINETIS_IRQ_USBOTG, khci_interrupt, NULL) != 0)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(KHCI_TRACEERR_IRQREGISTRATION),
|
||||
(uint16_t)KINETIS_IRQ_USBOTG);
|
||||
|
||||
@@ -164,14 +164,14 @@ static int kl_portinterrupt(int irq, FAR void *context,
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_KL_PORTAINTS
|
||||
static int kl_portainterrupt(int irq, FAR void *context)
|
||||
static int kl_portainterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
return kl_portinterrupt(irq, context, KL_PORTA_ISFR, g_portaisrs);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KL_PORTDINTS
|
||||
static int kl_portdinterrupt(int irq, FAR void *context)
|
||||
static int kl_portdinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
return kl_portinterrupt(irq, context, KL_PORTD_ISFR, g_portdisrs);
|
||||
}
|
||||
@@ -193,13 +193,13 @@ static int kl_portdinterrupt(int irq, FAR void *context)
|
||||
void kl_gpioirqinitialize(void)
|
||||
{
|
||||
#ifdef CONFIG_KL_PORTAINTS
|
||||
(void)irq_attach(KL_IRQ_PORTA, kl_portainterrupt);
|
||||
(void)irq_attach(KL_IRQ_PORTA, kl_portainterrupt, NULL);
|
||||
putreg32(0xffffffff, KL_PORTA_ISFR);
|
||||
up_enable_irq(KL_IRQ_PORTA);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KL_PORTDINTS
|
||||
(void)irq_attach(KL_IRQ_PORTD, kl_portdinterrupt);
|
||||
(void)irq_attach(KL_IRQ_PORTD, kl_portdinterrupt, NULL);
|
||||
putreg32(0xffffffff, KL_PORTD_ISFR);
|
||||
up_enable_irq(KL_IRQ_PORTD);
|
||||
#endif
|
||||
|
||||
@@ -138,7 +138,7 @@ static void kl_dumpnvic(const char *msg, int irq)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
static int kl_nmi(int irq, FAR void *context)
|
||||
static int kl_nmi(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! NMI received\n");
|
||||
@@ -146,7 +146,7 @@ static int kl_nmi(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kl_pendsv(int irq, FAR void *context)
|
||||
static int kl_pendsv(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! PendSV received\n");
|
||||
@@ -154,7 +154,7 @@ static int kl_pendsv(int irq, FAR void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kl_reserved(int irq, FAR void *context)
|
||||
static int kl_reserved(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
(void)up_irq_save();
|
||||
_err("PANIC!!! Reserved interrupt\n");
|
||||
@@ -231,15 +231,15 @@ void up_irqinitialize(void)
|
||||
* under certain conditions.
|
||||
*/
|
||||
|
||||
irq_attach(KL_IRQ_SVCALL, up_svcall);
|
||||
irq_attach(KL_IRQ_HARDFAULT, up_hardfault);
|
||||
irq_attach(KL_IRQ_SVCALL, up_svcall, NULL);
|
||||
irq_attach(KL_IRQ_HARDFAULT, up_hardfault, NULL);
|
||||
|
||||
/* Attach all other processor exceptions (except reset and sys tick) */
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
irq_attach(KL_IRQ_NMI, kl_nmi);
|
||||
irq_attach(KL_IRQ_PENDSV, kl_pendsv);
|
||||
irq_attach(KL_IRQ_RESERVED, kl_reserved);
|
||||
irq_attach(KL_IRQ_NMI, kl_nmi, NULL);
|
||||
irq_attach(KL_IRQ_PENDSV, kl_pendsv, NULL);
|
||||
irq_attach(KL_IRQ_RESERVED, kl_reserved, NULL);
|
||||
#endif
|
||||
|
||||
kl_dumpnvic("initial", NR_IRQS);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user