Update px4iofirmware, px4io and drivers to uses NuttX IRQ API changes

This commit is contained in:
David Sidrane 2017-02-28 16:32:32 -10:00 committed by Daniel Agar
parent bc81339a68
commit 21caf63e13
5 changed files with 16 additions and 16 deletions

View File

@ -82,7 +82,7 @@ static void unregister_interrupt(int irq);
* @param context The interrupt register context.
* @return Always returns OK.
*/
static int interrupt(int irq, void *context);
static int interrupt(int irq, void *context, void *arg);
Device::Device(const char *name,
int irq) :
@ -167,7 +167,7 @@ register_interrupt(int irq, Device *owner)
if (irq_entries[i].irq == 0) {
// great, we could put it here; try attaching it
ret = irq_attach(irq, &interrupt);
ret = irq_attach(irq, &interrupt, owner);
if (ret == OK) {
irq_entries[i].irq = irq;
@ -193,7 +193,7 @@ unregister_interrupt(int irq)
}
static int
interrupt(int irq, void *context)
interrupt(int irq, void *context, void *arg)
{
for (unsigned i = 0; i < irq_nentries; i++) {
if (irq_entries[i].irq == irq) {

View File

@ -262,7 +262,7 @@ private:
};
static int pwmin_tim_isr(int irq, void *context);
static int pwmin_tim_isr(int irq, void *context, void *arg);
static void pwmin_start();
static void pwmin_info(void);
static void pwmin_test(void);
@ -330,7 +330,7 @@ void PWMIN::_timer_init(void)
px4_arch_configgpio(GPIO_VDD_RANGEFINDER_EN);
/* claim our interrupt vector */
irq_attach(PWMIN_TIMER_VECTOR, pwmin_tim_isr);
irq_attach(PWMIN_TIMER_VECTOR, pwmin_tim_isr, NULL);
/* Clear no bits, set timer enable bit.*/
modifyreg32(PWMIN_TIMER_POWER_REG, 0, PWMIN_TIMER_POWER_BIT);
@ -544,7 +544,7 @@ void PWMIN::print_info(void)
/*
* Handle the interrupt, gathering pulse data
*/
static int pwmin_tim_isr(int irq, void *context)
static int pwmin_tim_isr(int irq, void *context, void *arg)
{
uint16_t status = rSR;
uint32_t period = rCCR_PWMIN_A;

View File

@ -136,7 +136,7 @@ private:
/**
* Serial interrupt handler.
*/
static int _interrupt(int vector, void *context);
static int _interrupt(int vector, void *context, void *arg);
void _do_interrupt();
/**
@ -291,7 +291,7 @@ PX4IO_serial::init()
rBRR = (mantissa << USART_BRR_MANT_SHIFT) | (fraction << USART_BRR_FRAC_SHIFT);
/* attach serial interrupt handler */
irq_attach(PX4IO_SERIAL_VECTOR, _interrupt);
irq_attach(PX4IO_SERIAL_VECTOR, _interrupt, NULL);
up_enable_irq(PX4IO_SERIAL_VECTOR);
/* enable UART in DMA mode, enable error and line idle interrupts */
@ -657,7 +657,7 @@ PX4IO_serial::_do_rx_dma_callback(unsigned status)
}
int
PX4IO_serial::_interrupt(int irq, void *context)
PX4IO_serial::_interrupt(int irq, void *context, void *arg)
{
if (g_interface != nullptr) {
g_interface->_do_interrupt();

View File

@ -65,7 +65,7 @@
#define rTRISE REG(STM32_I2C_TRISE_OFFSET)
void i2c_reset(void);
static int i2c_interrupt(int irq, void *context);
static int i2c_interrupt(int irq, void *context, void *args);
static void i2c_rx_setup(void);
static void i2c_tx_setup(void);
static void i2c_rx_complete(void);
@ -142,8 +142,8 @@ interface_init(void)
rOAR1 = 0x1a << 1;
/* enable event interrupts */
irq_attach(STM32_IRQ_I2C1EV, i2c_interrupt);
irq_attach(STM32_IRQ_I2C1ER, i2c_interrupt);
irq_attach(STM32_IRQ_I2C1EV, i2c_interrupt, NULL);
irq_attach(STM32_IRQ_I2C1ER, i2c_interrupt, NULL);
up_enable_irq(STM32_IRQ_I2C1EV);
up_enable_irq(STM32_IRQ_I2C1ER);
@ -192,7 +192,7 @@ i2c_reset(void)
}
static int
i2c_interrupt(int irq, FAR void *context)
i2c_interrupt(int irq, FAR void *context, FAR void *args)
{
uint16_t sr1 = rSR1;

View File

@ -71,7 +71,7 @@ static void rx_dma_callback(DMA_HANDLE handle, uint8_t status, void *arg);
static DMA_HANDLE tx_dma;
static DMA_HANDLE rx_dma;
static int serial_interrupt(int irq, void *context);
static int serial_interrupt(int irq, void *context, FAR void *arg);
static void dma_reset(void);
static struct IOPacket dma_packet;
@ -123,7 +123,7 @@ interface_init(void)
rBRR = (mantissa << USART_BRR_MANT_SHIFT) | (fraction << USART_BRR_FRAC_SHIFT);
/* connect our interrupt */
irq_attach(PX4FMU_SERIAL_VECTOR, serial_interrupt);
irq_attach(PX4FMU_SERIAL_VECTOR, serial_interrupt, NULL);
up_enable_irq(PX4FMU_SERIAL_VECTOR);
/* enable UART and error/idle interrupts */
@ -255,7 +255,7 @@ rx_dma_callback(DMA_HANDLE handle, uint8_t status, void *arg)
}
static int
serial_interrupt(int irq, void *context)
serial_interrupt(int irq, void *context, FAR void *arg)
{
static bool abort_on_idle = false;